home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / t2win-32 / _string.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-13  |  115KB  |  2,520 lines

  1. VERSION 5.00
  2. Begin VB.Form frmString 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "String"
  5.    ClientHeight    =   5235
  6.    ClientLeft      =   330
  7.    ClientTop       =   2385
  8.    ClientWidth     =   9765
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   5235
  13.    ScaleWidth      =   9765
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.PictureBox Picture1 
  16.       Align           =   2  'Align Bottom
  17.       BorderStyle     =   0  'None
  18.       FillColor       =   &H8000000F&
  19.       FillStyle       =   0  'Solid
  20.       Height          =   465
  21.       Left            =   0
  22.       ScaleHeight     =   465
  23.       ScaleWidth      =   9765
  24.       TabIndex        =   4
  25.       Top             =   4770
  26.       Width           =   9765
  27.       Begin VB.CommandButton Command2 
  28.          Caption         =   "&Reset"
  29.          Height          =   285
  30.          Left            =   8910
  31.          TabIndex        =   10
  32.          Top             =   105
  33.          Width           =   825
  34.       End
  35.       Begin VB.TextBox Text1 
  36.          Height          =   285
  37.          Left            =   1440
  38.          TabIndex        =   5
  39.          Tag             =   "A/BC/DEF/GHIJ/KLMNOP/"
  40.          Top             =   90
  41.          Width           =   7350
  42.       End
  43.       Begin VB.Label Label1 
  44.          Caption         =   "&Enter a test string"
  45.          Height          =   255
  46.          Left            =   90
  47.          TabIndex        =   6
  48.          Top             =   120
  49.          Width           =   1275
  50.       End
  51.    End
  52.    Begin VB.Frame Frame1 
  53.       Height          =   570
  54.       Left            =   0
  55.       TabIndex        =   1
  56.       Top             =   -90
  57.       Width           =   9735
  58.       Begin VB.CommandButton cmdNP 
  59.          Caption         =   ">"
  60.          Height          =   285
  61.          Index           =   1
  62.          Left            =   9360
  63.          TabIndex        =   9
  64.          Top             =   195
  65.          Width           =   285
  66.       End
  67.       Begin VB.CommandButton cmdNP 
  68.          Caption         =   "<"
  69.          Height          =   285
  70.          Index           =   0
  71.          Left            =   8460
  72.          TabIndex        =   8
  73.          Top             =   195
  74.          Width           =   285
  75.       End
  76.       Begin VB.CommandButton Command1 
  77.          Caption         =   "&Go"
  78.          Default         =   -1  'True
  79.          Height          =   285
  80.          Left            =   8820
  81.          TabIndex        =   7
  82.          Top             =   195
  83.          Width           =   465
  84.       End
  85.       Begin VB.ComboBox cmb_Function 
  86.          Height          =   315
  87.          Left            =   1365
  88.          TabIndex        =   2
  89.          Top             =   180
  90.          Width           =   7005
  91.       End
  92.       Begin VB.Label Label2 
  93.          Caption         =   "&Select a function"
  94.          Height          =   255
  95.          Left            =   90
  96.          TabIndex        =   3
  97.          Top             =   210
  98.          Width           =   1275
  99.       End
  100.    End
  101.    Begin VB.TextBox txt_Result 
  102.       BackColor       =   &H00C0C0C0&
  103.       BorderStyle     =   0  'None
  104.       Height          =   4005
  105.       Left            =   105
  106.       Locked          =   -1  'True
  107.       MultiLine       =   -1  'True
  108.       ScrollBars      =   2  'Vertical
  109.       TabIndex        =   0
  110.       Top             =   630
  111.       Width           =   9555
  112.    End
  113. Attribute VB_Name = "frmString"
  114. Attribute VB_GlobalNameSpace = False
  115. Attribute VB_Creatable = False
  116. Attribute VB_PredeclaredId = True
  117. Attribute VB_Exposed = False
  118. Option Explicit
  119. Option Base 1
  120. Private Const Iteration = 250
  121. Dim IsLoaded         As Integer
  122. Dim TimerStartOk     As Integer
  123. Dim TimerCloseOk     As Integer
  124. Dim TimerHandle      As Integer
  125. Dim TimerValue       As Long
  126. Private Sub cmdNP_Click(Index As Integer)
  127.    Call sub_NextPrev(cmb_Function, Index)
  128. End Sub
  129. Private Sub cmb_Function_Click()
  130.    If (IsLoaded = False) Then Exit Sub
  131.    Call cDisableFI(mdiT2W.Picture1)
  132.    Picture1.Visible = True
  133.    txt_Result = ""
  134.    DoEvents
  135.    Select Case cmb_Function.ListIndex
  136.       Case 0
  137.          Call TestOneCharFromLeft
  138.       Case 1
  139.          Call TestOneCharFromRight
  140.       Case 2
  141.          Call TestBlockCharFromLeft
  142.       Case 3
  143.          Call TestBlockCharFromRight
  144.       Case 4
  145.          Call TestGetIn
  146.       Case 5
  147.          Call TestGetInR
  148.       Case 6
  149.          Call TestGetInPart
  150.       Case 7
  151.          Call TestGetInPartR
  152.       Case 8
  153.          Call TestGetBlock
  154.       Case 9
  155.          Call TestInsertChars
  156.       Case 10
  157.          Call TestInsertByMask
  158.       Case 11
  159.          Call TestInsertBlocks
  160.       Case 12
  161.          Call TestInsertBlocksBy
  162.       Case 13
  163.          Call TestRemoveOneChar
  164.       Case 14
  165.          Call TestRemoveBlockChar
  166.       Case 15
  167.          Call TestTokenIn
  168.       Case 16
  169.          Picture1.Visible = False
  170.          Call TestOrTokenX
  171.       Case 17
  172.          Picture1.Visible = False
  173.          Call TestAndTokenX
  174.       Case 18
  175.          Call TestReverse
  176.       Case 19
  177.          Call TestMixChars
  178.       Case 20
  179.          Call TestScrollX
  180.       Case 21
  181.          Call TestChangeChars
  182.       Case 22
  183.          Call TestChangeCharsUntil
  184.       Case 23
  185.          Call TestCheckChars
  186.       Case 24
  187.          Call TestFilterChars
  188.       Case 25
  189.          Call TestFilterNotChars
  190.       Case 26
  191.          Call TestFilterBlocks
  192.       Case 27
  193.          Call TestResizeString
  194.       Case 28
  195.          Call TestResizeStringAndFill
  196.       Case 29
  197.          Call TestCreateAndFill
  198.       Case 30
  199.          Call TestFill
  200.       Case 31
  201.          Call TestLrc
  202.       Case 32
  203.          Call TestCompress
  204.       Case 33
  205.          Picture1.Visible = False
  206.          Call TestCompressTab
  207.       Case 34
  208.          Call TestCompact
  209.       Case 35
  210.          Call TestAlign
  211.       Case 36
  212.          Call TestProperName
  213.       Case 37
  214.          Call TestProperName2
  215.       Case 38
  216.          Call TestStringSAR
  217.       Case 39
  218.          Call TestToHexa
  219.       Case 40
  220.          Picture1.Visible = False
  221.          Call TestRomanArabic
  222.       Case 41
  223.          Call TestAsciiEbcdic
  224.       Case 42
  225.          Picture1.Visible = False
  226.          Call TestPatternMatch
  227.       Case 43
  228.          Picture1.Visible = False
  229.          Call TestPatternExtMatch
  230.       Case 44
  231.          Call TestCheckNumericity
  232.       Case 45
  233.          Call TestAlphaDigit
  234.       Case 46
  235.          Picture1.Visible = False
  236.          Call TestH2X
  237.       Case 47
  238.          Call TestSortStr
  239.       Case 48
  240.          Call TestMorse
  241.       Case 49
  242.          Call TestToZ9
  243.       Case 50
  244.          Call TestDeleteSubString
  245.       Case 51
  246.          Call TestStringReplace
  247.       Case 52
  248.          Call TestLRFill
  249.       Case 53
  250.          Call TestLRSetIn
  251.       Case 54
  252.          Call TestMatchTable
  253.       Case 55
  254.          Call TestInStr
  255.       Case 56
  256.          Call TestExtract
  257.       Case 57
  258.          Call TestExtractIsolate
  259.       Case 58
  260.          Call TestWrapLine
  261.       Case 59
  262.          Call TestRemoveReplace
  263.    End Select
  264.    DoEvents
  265.    Call cEnableFI(mdiT2W.Picture1)
  266. End Sub
  267. Private Sub Form_Activate()
  268.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  269. End Sub
  270. Private Sub Form_Load()
  271.    IsLoaded = False
  272.    Show
  273.    Text1.Text = Text1.Tag + Left$(LCase$(Text1.Tag), Len(Text1.Tag) - 1)
  274.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_string.t2w")
  275.    IsLoaded = True
  276. End Sub
  277. Private Sub Command1_Click()
  278.    Call cmb_Function_Click
  279. End Sub
  280. Private Sub TestOneCharFromLeft()
  281.    Dim intResult        As Integer
  282.    Dim strResult        As String
  283.    Dim strDisplay       As String
  284.    Dim i                As Integer
  285.    Dim Str1             As String
  286.    intResult = 0
  287.    strResult = ""
  288.    strDisplay = ""
  289.      
  290.    Str1 = Text1.Text
  291.    strDisplay = strDisplay & "The 3,7,1,21,14 chars from left of '" & Str1 & "' are " & vbCrLf & vbCrLf
  292.    strDisplay = strDisplay & "03: '" & cOneCharFromLeft(Str1, 3) & "'" & vbCrLf
  293.    strDisplay = strDisplay & "07: '" & cOneCharFromLeft(Str1, 7) & "'" & vbCrLf
  294.    strDisplay = strDisplay & "01: '" & cOneCharFromLeft(Str1, 1) & "'" & vbCrLf
  295.    strDisplay = strDisplay & "21: '" & cOneCharFromLeft(Str1, 21) & "'" & vbCrLf
  296.    strDisplay = strDisplay & "14: '" & cOneCharFromLeft(Str1, 14) & "'" & vbCrLf
  297.    txt_Result = strDisplay
  298.    'time the function
  299.    TimerHandle = cTimerOpen()
  300.    TimerStartOk = cTimerStart(TimerHandle)
  301.    For i = 1 To Iteration
  302.       strResult = cOneCharFromLeft(Str1, 3)
  303.    Next i
  304.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  305.    TimerCloseOk = cTimerClose(TimerHandle)
  306. End Sub
  307. Private Sub Command2_Click()
  308.    Text1.Text = Text1.Tag + Left$(LCase$(Text1.Tag), Len(Text1.Tag) - 1)
  309.    Call Command1_Click
  310. End Sub
  311. Private Sub TestOneCharFromRight()
  312.    Dim intResult        As Integer
  313.    Dim strResult        As String
  314.    Dim strDisplay       As String
  315.    Dim i                As Integer
  316.    Dim Str1             As String
  317.    intResult = 0
  318.    strResult = ""
  319.    strDisplay = ""
  320.      
  321.    Str1 = Text1.Text
  322.    strDisplay = strDisplay & "The 3,7,1,21,14 chars from right of '" & Str1 & "' are " & vbCrLf & vbCrLf
  323.    strDisplay = strDisplay & "03: '" & cOneCharFromRight(Str1, 3) & "'" & vbCrLf
  324.    strDisplay = strDisplay & "07: '" & cOneCharFromRight(Str1, 7) & "'" & vbCrLf
  325.    strDisplay = strDisplay & "01: '" & cOneCharFromRight(Str1, 1) & "'" & vbCrLf
  326.    strDisplay = strDisplay & "21: '" & cOneCharFromRight(Str1, 21) & "'" & vbCrLf
  327.    strDisplay = strDisplay & "14: '" & cOneCharFromRight(Str1, 14) & "'" & vbCrLf
  328.    txt_Result = strDisplay
  329.    'time the function
  330.    TimerHandle = cTimerOpen()
  331.    TimerStartOk = cTimerStart(TimerHandle)
  332.    For i = 1 To Iteration
  333.       strResult = cOneCharFromRight(Str1, 3)
  334.    Next i
  335.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  336.    TimerCloseOk = cTimerClose(TimerHandle)
  337. End Sub
  338. Private Sub TestBlockCharFromLeft()
  339.    Dim intResult        As Integer
  340.    Dim strResult        As String
  341.    Dim strDisplay       As String
  342.    Dim i                As Integer
  343.    Dim Str1             As String
  344.    intResult = 0
  345.    strResult = ""
  346.    strDisplay = ""
  347.      
  348.    Str1 = Text1.Text
  349.    strDisplay = strDisplay & "The 3,7,1,21,14 blocks from left of '" & Str1 & "' are " & vbCrLf & vbCrLf
  350.    strDisplay = strDisplay & "03: '" & cBlockCharFromLeft(Str1, 3) & "'" & vbCrLf
  351.    strDisplay = strDisplay & "07: '" & cBlockCharFromLeft(Str1, 7) & "'" & vbCrLf
  352.    strDisplay = strDisplay & "01: '" & cBlockCharFromLeft(Str1, 1) & "'" & vbCrLf
  353.    strDisplay = strDisplay & "21: '" & cBlockCharFromLeft(Str1, 21) & "'" & vbCrLf
  354.    strDisplay = strDisplay & "14: '" & cBlockCharFromLeft(Str1, 14) & "'" & vbCrLf
  355.    txt_Result = strDisplay
  356.    'time the function
  357.    TimerHandle = cTimerOpen()
  358.    TimerStartOk = cTimerStart(TimerHandle)
  359.    For i = 1 To Iteration
  360.       strResult = cBlockCharFromLeft(Str1, 3)
  361.    Next i
  362.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  363.    TimerCloseOk = cTimerClose(TimerHandle)
  364. End Sub
  365. Private Sub TestBlockCharFromRight()
  366.    Dim intResult        As Integer
  367.    Dim strResult        As String
  368.    Dim strDisplay       As String
  369.    Dim i                As Integer
  370.    Dim Str1             As String
  371.    intResult = 0
  372.    strResult = ""
  373.    strDisplay = ""
  374.      
  375.    Str1 = Text1.Text
  376.    strDisplay = strDisplay & "The 3,7,1,21,14 blocks from right of '" & Str1 & "' are " & vbCrLf & vbCrLf
  377.    strDisplay = strDisplay & "03: '" & cBlockCharFromRight(Str1, 3) & "'" & vbCrLf
  378.    strDisplay = strDisplay & "07: '" & cBlockCharFromRight(Str1, 7) & "'" & vbCrLf
  379.    strDisplay = strDisplay & "01: '" & cBlockCharFromRight(Str1, 1) & "'" & vbCrLf
  380.    strDisplay = strDisplay & "21: '" & cBlockCharFromRight(Str1, 21) & "'" & vbCrLf
  381.    strDisplay = strDisplay & "14: '" & cBlockCharFromRight(Str1, 14) & "'" & vbCrLf
  382.    txt_Result = strDisplay
  383.    'time the function
  384.    TimerHandle = cTimerOpen()
  385.    TimerStartOk = cTimerStart(TimerHandle)
  386.    For i = 1 To Iteration
  387.       strResult = cBlockCharFromRight(Str1, 3)
  388.    Next i
  389.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  390.    TimerCloseOk = cTimerClose(TimerHandle)
  391. End Sub
  392. Private Sub TestGetIn()
  393.    Dim intResult        As Integer
  394.    Dim strResult        As String
  395.    Dim strDisplay       As String
  396.    Dim i                As Integer
  397.    Dim Str1             As String
  398.    Dim Sep1             As String
  399.    intResult = 0
  400.    strResult = ""
  401.    strDisplay = ""
  402.      
  403.    Str1 = Text1.Text
  404.    Sep1 = "/"
  405.    strDisplay = strDisplay & "The 3,7,1,5,2,0 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  406.    strDisplay = strDisplay & "3: '" & cGetIn(Str1, Sep1, 3) & "'" & vbCrLf
  407.    strDisplay = strDisplay & "7: '" & cGetIn(Str1, Sep1, 7) & "'" & vbCrLf
  408.    strDisplay = strDisplay & "1: '" & cGetIn(Str1, Sep1, 1) & "'" & vbCrLf
  409.    strDisplay = strDisplay & "5: '" & cGetIn(Str1, Sep1, 5) & "'" & vbCrLf
  410.    strDisplay = strDisplay & "2: '" & cGetIn(Str1, Sep1, 2) & "'" & vbCrLf
  411.    strDisplay = strDisplay & "0: '" & cGetIn(Str1, Sep1, 0) & "'" & vbCrLf & vbCrLf
  412.    Sep1 = "G"
  413.    strDisplay = strDisplay & "The 1,2 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  414.    strDisplay = strDisplay & "1: '" & cGetIn(Str1, Sep1, 1) & "'" & vbCrLf
  415.    strDisplay = strDisplay & "2: '" & cGetIn(Str1, Sep1, 2) & "'" & vbCrLf & vbCrLf
  416.    Sep1 = "g"
  417.    strDisplay = strDisplay & "The 2,1 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  418.    strDisplay = strDisplay & "2: '" & cGetIn(Str1, Sep1, 2) & "'" & vbCrLf
  419.    strDisplay = strDisplay & "1: '" & cGetIn(Str1, Sep1, 1) & "'"
  420.    txt_Result = strDisplay
  421.    'time the function
  422.    TimerHandle = cTimerOpen()
  423.    TimerStartOk = cTimerStart(TimerHandle)
  424.    For i = 1 To Iteration
  425.       strResult = cGetIn(Str1, "/", 3)
  426.    Next i
  427.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  428.    TimerCloseOk = cTimerClose(TimerHandle)
  429. End Sub
  430. Private Sub TestGetInR()
  431.    Dim intResult        As Integer
  432.    Dim strResult        As String
  433.    Dim strDisplay       As String
  434.    Dim i                As Integer
  435.    Dim Str1             As String
  436.    Dim Sep1             As String
  437.    intResult = 0
  438.    strResult = ""
  439.    strDisplay = ""
  440.      
  441.    Str1 = Text1.Text
  442.    Sep1 = "/"
  443.    strDisplay = strDisplay & "The 3,7,1,5,2,0 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  444.    strDisplay = strDisplay & "3: '" & cGetInR(Str1, Sep1, 3) & "'" & vbCrLf
  445.    strDisplay = strDisplay & "7: '" & cGetInR(Str1, Sep1, 7) & "'" & vbCrLf
  446.    strDisplay = strDisplay & "1: '" & cGetInR(Str1, Sep1, 1) & "'" & vbCrLf
  447.    strDisplay = strDisplay & "5: '" & cGetInR(Str1, Sep1, 5) & "'" & vbCrLf
  448.    strDisplay = strDisplay & "2: '" & cGetInR(Str1, Sep1, 2) & "'" & vbCrLf
  449.    strDisplay = strDisplay & "0: '" & cGetInR(Str1, Sep1, 0) & "'" & vbCrLf & vbCrLf
  450.    Sep1 = "G"
  451.    strDisplay = strDisplay & "The 1,2 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  452.    strDisplay = strDisplay & "1: '" & cGetInR(Str1, Sep1, 1) & "'" & vbCrLf
  453.    strDisplay = strDisplay & "2: '" & cGetInR(Str1, Sep1, 2) & "'" & vbCrLf & vbCrLf
  454.    Sep1 = "g"
  455.    strDisplay = strDisplay & "The 2,1 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  456.    strDisplay = strDisplay & "2: '" & cGetInR(Str1, Sep1, 2) & "'" & vbCrLf
  457.    strDisplay = strDisplay & "1: '" & cGetInR(Str1, Sep1, 1) & "'"
  458.    txt_Result = strDisplay
  459.    'time the function
  460.    TimerHandle = cTimerOpen()
  461.    TimerStartOk = cTimerStart(TimerHandle)
  462.    For i = 1 To Iteration
  463.       strResult = cGetInR(Str1, Sep1, 3)
  464.    Next i
  465.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  466.    TimerCloseOk = cTimerClose(TimerHandle)
  467. End Sub
  468. Private Sub TestGetInPart()
  469.    Dim intResult        As Integer
  470.    Dim strResult        As String
  471.    Dim strDisplay       As String
  472.    Dim i                As Integer
  473.    Dim Str1             As String
  474.    Dim Sep1             As String
  475.    intResult = 0
  476.    strResult = ""
  477.    strDisplay = ""
  478.      
  479.    Str1 = Text1.Text
  480.    Sep1 = "/"
  481.    strDisplay = strDisplay & "The first and the second part from the left of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  482.    strDisplay = strDisplay & "First: '" & cGetInPart(Str1, Sep1, True) & "'" & vbCrLf
  483.    strDisplay = strDisplay & "Second: '" & cGetInPart(Str1, Sep1, False) & "'" & vbCrLf & vbCrLf
  484.    Sep1 = "G"
  485.    strDisplay = strDisplay & "The first and the second part from the left of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  486.    strDisplay = strDisplay & "First: '" & cGetInPart(Str1, Sep1, True) & "'" & vbCrLf
  487.    strDisplay = strDisplay & "Second: '" & cGetInPart(Str1, Sep1, False) & "'" & vbCrLf & vbCrLf
  488.    Sep1 = "g"
  489.    strDisplay = strDisplay & "The first and the second part from the left of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  490.    strDisplay = strDisplay & "First: '" & cGetInPart(Str1, Sep1, True) & "'" & vbCrLf
  491.    strDisplay = strDisplay & "Second: '" & cGetInPart(Str1, Sep1, False) & "'"
  492.    txt_Result = strDisplay
  493.    'time the function
  494.    TimerHandle = cTimerOpen()
  495.    TimerStartOk = cTimerStart(TimerHandle)
  496.    For i = 1 To Iteration
  497.       strResult = cGetInPart(Str1, Sep1, True)
  498.    Next i
  499.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  500.    TimerCloseOk = cTimerClose(TimerHandle)
  501. End Sub
  502. Private Sub TestGetInPartR()
  503.    Dim intResult        As Integer
  504.    Dim strResult        As String
  505.    Dim strDisplay       As String
  506.    Dim i                As Integer
  507.    Dim Str1             As String
  508.    Dim Sep1             As String
  509.    intResult = 0
  510.    strResult = ""
  511.    strDisplay = ""
  512.      
  513.    Str1 = Text1.Text
  514.    Sep1 = "/"
  515.    strDisplay = strDisplay & "The first and the second part from the left of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  516.    strDisplay = strDisplay & "First: '" & cGetInPartR(Str1, Sep1, True) & "'" & vbCrLf
  517.    strDisplay = strDisplay & "Second: '" & cGetInPartR(Str1, Sep1, False) & "'" & vbCrLf & vbCrLf
  518.    Sep1 = "G"
  519.    strDisplay = strDisplay & "The first and the second part from the left of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  520.    strDisplay = strDisplay & "First: '" & cGetInPartR(Str1, Sep1, True) & "'" & vbCrLf
  521.    strDisplay = strDisplay & "Second: '" & cGetInPartR(Str1, Sep1, False) & "'" & vbCrLf & vbCrLf
  522.    Sep1 = "g"
  523.    strDisplay = strDisplay & "The first and the second part from the left of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  524.    strDisplay = strDisplay & "First: '" & cGetInPartR(Str1, Sep1, True) & "'" & vbCrLf
  525.    strDisplay = strDisplay & "Second: '" & cGetInPartR(Str1, Sep1, False) & "'"
  526.    txt_Result = strDisplay
  527.    'time the function
  528.    TimerHandle = cTimerOpen()
  529.    TimerStartOk = cTimerStart(TimerHandle)
  530.    For i = 1 To Iteration
  531.       strResult = cGetInPartR(Str1, Sep1, True)
  532.    Next i
  533.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  534.    TimerCloseOk = cTimerClose(TimerHandle)
  535. End Sub
  536. Private Sub TestGetBlock()
  537.    Dim intResult        As Integer
  538.    Dim strResult        As String
  539.    Dim strDisplay       As String
  540.    Dim i                As Integer
  541.    Dim Str1             As String
  542.    Dim BlockSize        As Integer
  543.    intResult = 0
  544.    strResult = ""
  545.    strDisplay = ""
  546.      
  547.    Str1 = Text1.Text
  548.    BlockSize = 2
  549.    strDisplay = strDisplay & "The 3,7,1,5,2,0 blocks of '" & Str1 & "' (block size '" & BlockSize & "') are " & vbCrLf & vbCrLf
  550.    strDisplay = strDisplay & "3: '" & cGetBlock(Str1, 3, BlockSize) & "'" & vbCrLf
  551.    strDisplay = strDisplay & "7: '" & cGetBlock(Str1, 7, BlockSize) & "'" & vbCrLf
  552.    strDisplay = strDisplay & "1: '" & cGetBlock(Str1, 1, BlockSize) & "'" & vbCrLf
  553.    strDisplay = strDisplay & "5: '" & cGetBlock(Str1, 5, BlockSize) & "'" & vbCrLf
  554.    strDisplay = strDisplay & "2: '" & cGetBlock(Str1, 2, BlockSize) & "'" & vbCrLf
  555.    strDisplay = strDisplay & "0: '" & cGetBlock(Str1, 0, BlockSize) & "'" & vbCrLf & vbCrLf
  556.    BlockSize = 3
  557.    strDisplay = strDisplay & "The 1,2 blocks of '" & Str1 & "' (block size '" & BlockSize & "') are " & vbCrLf & vbCrLf
  558.    strDisplay = strDisplay & "1: '" & cGetBlock(Str1, 1, BlockSize) & "'" & vbCrLf
  559.    strDisplay = strDisplay & "2: '" & cGetBlock(Str1, 2, BlockSize) & "'" & vbCrLf & vbCrLf
  560.    BlockSize = 4
  561.    strDisplay = strDisplay & "The 2,1 blocks of '" & Str1 & "' (block size '" & BlockSize & "') are " & vbCrLf & vbCrLf
  562.    strDisplay = strDisplay & "2: '" & cGetBlock(Str1, 2, BlockSize) & "'" & vbCrLf
  563.    strDisplay = strDisplay & "1: '" & cGetBlock(Str1, 1, BlockSize) & "'"
  564.    txt_Result = strDisplay
  565.    'time the function
  566.    TimerHandle = cTimerOpen()
  567.    TimerStartOk = cTimerStart(TimerHandle)
  568.    For i = 1 To Iteration
  569.       strResult = cGetBlock(Str1, BlockSize, 3)
  570.    Next i
  571.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  572.    TimerCloseOk = cTimerClose(TimerHandle)
  573. End Sub
  574. Private Sub TestInsertChars()
  575.    Dim intResult        As Integer
  576.    Dim strResult        As String
  577.    Dim strDisplay       As String
  578.    Dim i                As Integer
  579.    Dim Str1             As String
  580.    intResult = 0
  581.    strResult = ""
  582.    strDisplay = ""
  583.      
  584.    Str1 = Text1.Text
  585.    strDisplay = strDisplay & "Insert 'a' from 7 char into '" & Str1 & "' is " & vbCrLf & vbCrLf
  586.    strDisplay = strDisplay & cInsertChars(Str1, 7, "a") & vbCrLf & vbCrLf
  587.    strDisplay = strDisplay & "Insert '10$' from 2 char into '" & Str1 & "' is " & vbCrLf & vbCrLf
  588.    strDisplay = strDisplay & cInsertChars(Str1, 2, "10$") & vbCrLf & vbCrLf
  589.    strDisplay = strDisplay & "Insert '@' from 21 char into '" & Str1 & "' is " & vbCrLf & vbCrLf
  590.    strDisplay = strDisplay & cInsertChars(Str1, 21, "@") & vbCrLf & vbCrLf
  591.    txt_Result = strDisplay
  592.    'time the function
  593.    TimerHandle = cTimerOpen()
  594.    TimerStartOk = cTimerStart(TimerHandle)
  595.    For i = 1 To Iteration
  596.       strResult = cInsertChars(Str1, 1, "a")
  597.    Next i
  598.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  599.    TimerCloseOk = cTimerClose(TimerHandle)
  600. End Sub
  601. Private Sub TestInsertByMask()
  602.    Dim intResult        As Integer
  603.    Dim strResult        As String
  604.    Dim strDisplay       As String
  605.    Dim i                As Integer
  606.    Dim Str1             As String
  607.    Dim Str2             As String
  608.    Dim Mask1            As String
  609.    intResult = 0
  610.    strResult = ""
  611.    strDisplay = ""
  612.      
  613.    Str1 = "Nr ## Price $###.##"
  614.    Str2 = "0705200"
  615.    Mask1 = "#"
  616.    strDisplay = strDisplay & "Insert '" & Str2 & "' into '" & Str1 & "' is " & vbCrLf & vbCrLf
  617.    strDisplay = strDisplay & cInsertByMask(Str1, Mask1, Str2) & vbCrLf & vbCrLf
  618.    Str1 = Text1.Text
  619.    Str2 = String(cCount(Str1, "/"), "*")
  620.    Mask1 = "/"
  621.    strDisplay = strDisplay & "Insert '" & Str2 & "' into '" & Str1 & "' is " & vbCrLf & vbCrLf
  622.    strDisplay = strDisplay & cInsertByMask(Str1, Mask1, Str2) & vbCrLf & vbCrLf
  623.    txt_Result = strDisplay
  624.    'time the function
  625.    TimerHandle = cTimerOpen()
  626.    TimerStartOk = cTimerStart(TimerHandle)
  627.    For i = 1 To Iteration
  628.       strResult = cInsertByMask(Str1, Mask1, Str2)
  629.    Next i
  630.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  631.    TimerCloseOk = cTimerClose(TimerHandle)
  632. End Sub
  633. Private Sub TestInsertBlocks()
  634.    Dim intResult        As Integer
  635.    Dim strResult        As String
  636.    Dim strDisplay       As String
  637.    Dim i                As Integer
  638.    Dim Str1             As String
  639.    Dim Str2             As String
  640.    intResult = 0
  641.    strResult = ""
  642.    strDisplay = ""
  643.      
  644.    Str1 = "A~BC~DEF~GHIJ~"
  645.    Str2 = "a~bc~def~ghij"
  646.    strDisplay = strDisplay + "Insert (InsertBlocks) '" & Str2 & "' into '" & Str1 & "' is " & vbCrLf & vbCrLf
  647.    strDisplay = strDisplay & cInsertBlocks(Str1, Str2) & vbCrLf & vbCrLf
  648.    Str1 = "A~BC~DEF~GHIJ~"
  649.    Str2 = ""
  650.    strDisplay = strDisplay + "Insert (InsertBlocks) '' into '" & Str1 & "' is " & vbCrLf & vbCrLf
  651.    strDisplay = strDisplay & cInsertBlocks(Str1, Str2) & vbCrLf & vbCrLf
  652.    Str1 = "A~BC~DEF~GHIJ~"
  653.    Str2 = ""
  654.    strDisplay = strDisplay + "Insert (InsertBlocksExt) '' into '" & Str1 & "' is " & vbCrLf & vbCrLf
  655.    strDisplay = strDisplay & cInsertBlocksExt(Str1, Str2) & vbCrLf & vbCrLf
  656.    txt_Result = strDisplay
  657.    'time the function
  658.    TimerHandle = cTimerOpen()
  659.    TimerStartOk = cTimerStart(TimerHandle)
  660.    For i = 1 To Iteration
  661.       strResult = cInsertBlocks(Str1, Str2)
  662.    Next i
  663.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  664.    TimerCloseOk = cTimerClose(TimerHandle)
  665. End Sub
  666. Public Sub TestInsertBlocksBy()
  667.    Dim intResult        As Integer
  668.    Dim strResult        As String
  669.    Dim strDisplay       As String
  670.    Dim i                As Integer
  671.    Dim Str1             As String
  672.    Dim Str2             As String
  673.    Dim Sep1             As String
  674.    intResult = 0
  675.    strResult = ""
  676.    strDisplay = ""
  677.      
  678.    Str1 = Text1.Text
  679.    Str2 = "a/bc/def/ghij"
  680.    Sep1 = "/"
  681.    strDisplay = strDisplay + "Insert '" & Str2 & "' into '" & Str1 & "' is " & vbCrLf & vbCrLf
  682.    strDisplay = strDisplay & cInsertBlocksBy(Str1, Str2, Sep1) & vbCrLf & vbCrLf
  683.    Str1 = Text1.Text
  684.    Str2 = ""
  685.    strDisplay = strDisplay + "Insert '' into '" & Str1 & "' is " & vbCrLf & vbCrLf
  686.    strDisplay = strDisplay & cInsertBlocksBy(Str1, Str2, Sep1) & vbCrLf & vbCrLf
  687.    txt_Result = strDisplay
  688.    'time the function
  689.    TimerHandle = cTimerOpen()
  690.    TimerStartOk = cTimerStart(TimerHandle)
  691.    For i = 1 To Iteration
  692.       strResult = cInsertBlocksBy(Str1, Str2, Sep1)
  693.    Next i
  694.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  695.    TimerCloseOk = cTimerClose(TimerHandle)
  696. End Sub
  697. Private Sub TestRemoveOneChar()
  698.    Dim intResult        As Integer
  699.    Dim strResult        As String
  700.    Dim strDisplay       As String
  701.    Dim i                As Integer
  702.    Dim Str1             As String
  703.    intResult = 0
  704.    strResult = ""
  705.    strDisplay = ""
  706.      
  707.    Str1 = Text1.Text
  708.    strDisplay = strDisplay & "Removing the 7 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  709.    strDisplay = strDisplay & cRemoveOneChar(Str1, 7) & vbCrLf & vbCrLf
  710.    Str1 = Text1.Text
  711.    strDisplay = strDisplay & "Removing the 21 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  712.    strDisplay = strDisplay & cRemoveOneChar(Str1, 21) & vbCrLf & vbCrLf
  713.    Str1 = Text1.Text
  714.    strDisplay = strDisplay & "Removing the 14 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  715.    strDisplay = strDisplay & cRemoveOneChar(Str1, 14) & vbCrLf & vbCrLf
  716.    Str1 = Text1.Text
  717.    strDisplay = strDisplay & "Removing the 0 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  718.    strDisplay = strDisplay & cRemoveOneChar(Str1, 0) & vbCrLf & vbCrLf
  719.    Str1 = Text1.Text
  720.    strDisplay = strDisplay & "Removing the 1 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  721.    strDisplay = strDisplay & cRemoveOneChar(Str1, 1)
  722.    txt_Result = strDisplay
  723.    'time the function
  724.    Str1 = Text1.Text
  725.    TimerHandle = cTimerOpen()
  726.    TimerStartOk = cTimerStart(TimerHandle)
  727.    For i = 1 To Iteration
  728.       strResult = cRemoveOneChar(Str1, 7)
  729.    Next i
  730.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  731.    TimerCloseOk = cTimerClose(TimerHandle)
  732. End Sub
  733. Public Sub TestRemoveBlockChar()
  734.    Dim intResult        As Integer
  735.    Dim strResult        As String
  736.    Dim strDisplay       As String
  737.    Dim i                As Integer
  738.    Dim Str1             As String
  739.    intResult = 0
  740.    strResult = ""
  741.    strDisplay = ""
  742.      
  743.    Str1 = Text1.Text
  744.    strDisplay = strDisplay & "Removing 3 chars from the 7 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  745.    strDisplay = strDisplay & cRemoveBlockChar(Str1, 7, 3) & vbCrLf & vbCrLf
  746.    Str1 = Text1.Text
  747.    strDisplay = strDisplay & "Removing 2 chars from the 21 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  748.    strDisplay = strDisplay & cRemoveBlockChar(Str1, 21, 2) & vbCrLf & vbCrLf
  749.    Str1 = Text1.Text
  750.    strDisplay = strDisplay & "Removing 7 chars from the 14 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  751.    strDisplay = strDisplay & cRemoveBlockChar(Str1, 14, 7) & vbCrLf & vbCrLf
  752.    Str1 = Text1.Text
  753.    strDisplay = strDisplay & "Removing 14 chars from the 0 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  754.    strDisplay = strDisplay & cRemoveBlockChar(Str1, 0, 14) & vbCrLf & vbCrLf
  755.    Str1 = Text1.Text
  756.    strDisplay = strDisplay & "Removing 50 chars from the 1 char of '" & Str1 & "' is " & vbCrLf & vbCrLf
  757.    strDisplay = strDisplay & cRemoveBlockChar(Str1, 1, 50)
  758.    txt_Result = strDisplay
  759.    'time the function
  760.    Str1 = Text1.Text
  761.    TimerHandle = cTimerOpen()
  762.    TimerStartOk = cTimerStart(TimerHandle)
  763.    For i = 1 To Iteration
  764.       strResult = cRemoveBlockChar(Str1, 1, 1)
  765.    Next i
  766.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  767.    TimerCloseOk = cTimerClose(TimerHandle)
  768. End Sub
  769. Private Sub TestTokenIn()
  770.    Dim intResult        As Integer
  771.    Dim strResult        As String
  772.    Dim strDisplay       As String
  773.    Dim i                As Integer
  774.    Dim Str1             As String
  775.    Dim Sep1             As String
  776.    intResult = 0
  777.    strResult = ""
  778.    strDisplay = ""
  779.      
  780.    Str1 = Text1.Text
  781.    Sep1 = "/HM"
  782.    strDisplay = strDisplay & "The 3,7,1,5,2,0 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  783.    strDisplay = strDisplay & "3: '" & cTokenIn(Str1, Sep1, 3) & "'" & vbCrLf
  784.    strDisplay = strDisplay & "7: '" & cTokenIn(Str1, Sep1, 7) & "'" & vbCrLf
  785.    strDisplay = strDisplay & "1: '" & cTokenIn(Str1, Sep1, 1) & "'" & vbCrLf
  786.    strDisplay = strDisplay & "5: '" & cTokenIn(Str1, Sep1, 5) & "'" & vbCrLf
  787.    strDisplay = strDisplay & "2: '" & cTokenIn(Str1, Sep1, 2) & "'" & vbCrLf
  788.    strDisplay = strDisplay & "0: '" & cTokenIn(Str1, Sep1, 0) & "'" & vbCrLf & vbCrLf
  789.    Sep1 = "G"
  790.    strDisplay = strDisplay & "The 1,2 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  791.    strDisplay = strDisplay & "1: '" & cTokenIn(Str1, Sep1, 1) & "'" & vbCrLf
  792.    strDisplay = strDisplay & "2: '" & cTokenIn(Str1, Sep1, 2) & "'" & vbCrLf & vbCrLf
  793.    Sep1 = "g"
  794.    strDisplay = strDisplay & "The 2,1 blocks of '" & Str1 & "' (separator '" & Sep1 & "') are " & vbCrLf & vbCrLf
  795.    strDisplay = strDisplay & "2: '" & cTokenIn(Str1, Sep1, 2) & "'" & vbCrLf
  796.    strDisplay = strDisplay & "1: '" & cTokenIn(Str1, Sep1, 1) & "'"
  797.    txt_Result = strDisplay
  798.    'time the function
  799.    TimerHandle = cTimerOpen()
  800.    TimerStartOk = cTimerStart(TimerHandle)
  801.    For i = 1 To Iteration
  802.       strResult = cTokenIn(Str1, Sep1, 3)
  803.    Next i
  804.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  805.    TimerCloseOk = cTimerClose(TimerHandle)
  806. End Sub
  807. Private Sub TestOrTokenX()
  808.    Dim intResult        As Integer
  809.    Dim strResult        As String
  810.    Dim strDisplay       As String
  811.    Dim i                As Integer
  812.    Dim Str1             As String
  813.    Dim Str2             As String
  814.    Dim Sep1             As String
  815.    intResult = 0
  816.    strResult = ""
  817.    strDisplay = ""
  818.    Sep1 = "\"
  819.      
  820.    Str1 = "FOX|OVER|THE"
  821.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  822.    strDisplay = strDisplay & "One of token '" & Str1 & "' (|) in '" & Str2 & "' is " & IIf(cOrToken(Str2, Str1), "present", "not present") & vbCrLf & vbCrLf
  823.    Str1 = "quick|jumps|the"
  824.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  825.    strDisplay = strDisplay & "One of token '" & Str1 & "' (|) in '" & Str2 & "' is " & IIf(cOrToken(Str2, Str1), "present", "not present") & vbCrLf & vbCrLf
  826.    Str1 = "FOX\OVER\THE"
  827.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  828.    strDisplay = strDisplay & "One of token '" & Str1 & "' (\) in '" & Str2 & "' is " & IIf(cOrTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  829.    Str1 = "quick\jumps\the"
  830.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  831.    strDisplay = strDisplay & "One of token '" & Str1 & "' (\) in '" & Str2 & "' is " & IIf(cOrTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  832.    Str1 = "FOX/OVER/THE"
  833.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  834.    strDisplay = strDisplay & "One of token '" & Str1 & "' (\) in '" & Str2 & "' is " & IIf(cOrTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  835.    Str1 = "quick\JUMPS\the"
  836.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  837.    strDisplay = strDisplay & "One of token '" & Str1 & "' (\) in '" & Str2 & "' is " & IIf(cOrTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  838.    Str1 = LCase$("quick\jumps\THE")
  839.    Str2 = LCase$("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG")
  840.    strDisplay = strDisplay & "One of token '" & Str1 & "' (\) in '" & Str2 & "' is " & IIf(cOrTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  841.    txt_Result = strDisplay
  842.    'time the function
  843.    TimerHandle = cTimerOpen()
  844.    TimerStartOk = cTimerStart(TimerHandle)
  845.    For i = 1 To Iteration
  846.       strResult = cOrTokenIn(Str2, Str1, Sep1)
  847.    Next i
  848.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  849.    TimerCloseOk = cTimerClose(TimerHandle)
  850. End Sub
  851. Private Sub TestAndTokenX()
  852.    Dim intResult        As Integer
  853.    Dim strResult        As String
  854.    Dim strDisplay       As String
  855.    Dim i                As Integer
  856.    Dim Str1             As String
  857.    Dim Str2             As String
  858.    Dim Sep1             As String
  859.    intResult = 0
  860.    strResult = ""
  861.    strDisplay = ""
  862.      
  863.    Sep1 = "\"
  864.      
  865.    Str1 = "FOX|OVER|THE"
  866.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  867.    strDisplay = strDisplay & "All tokens '" & Str1 & "' (|) in '" & Str2 & "' are " & IIf(cAndToken(Str2, Str1), "present", "not present") & vbCrLf & vbCrLf
  868.    Str1 = "quick|jumps|the"
  869.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  870.    strDisplay = strDisplay & "All tokens '" & Str1 & "' (|) in '" & Str2 & "' are " & IIf(cAndToken(Str2, Str1), "present", "not present") & vbCrLf & vbCrLf
  871.    Str1 = "FOX\OVER\THE"
  872.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  873.    strDisplay = strDisplay & "All tokens '" & Str1 & "' (\) in '" & Str2 & "' are " & IIf(cAndTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  874.    Str1 = "quick\jumps\the"
  875.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  876.    strDisplay = strDisplay & "All tokens '" & Str1 & "' (\) in '" & Str2 & "' are " & IIf(cAndTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  877.    Str1 = "FOX/OVER/THE"
  878.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  879.    strDisplay = strDisplay & "All tokens '" & Str1 & "' (\) in '" & Str2 & "' are " & IIf(cAndTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  880.    Str1 = "quick\JUMPS\the"
  881.    Str2 = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG"
  882.    strDisplay = strDisplay & "All tokens '" & Str1 & "' (\) in '" & Str2 & "' are " & IIf(cAndTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  883.    Str1 = LCase$("quick\jumps\THE")
  884.    Str2 = LCase$("THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG")
  885.    strDisplay = strDisplay & "All tokens '" & Str1 & "' (\) in '" & Str2 & "' are " & IIf(cAndTokenIn(Str2, Str1, Sep1), "present", "not present") & vbCrLf & vbCrLf
  886.    txt_Result = strDisplay
  887.    'time the function
  888.    TimerHandle = cTimerOpen()
  889.    TimerStartOk = cTimerStart(TimerHandle)
  890.    For i = 1 To Iteration
  891.       strResult = cOrTokenIn(Str2, Str1, Sep1)
  892.    Next i
  893.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  894.    TimerCloseOk = cTimerClose(TimerHandle)
  895. End Sub
  896. Private Sub TestReverse()
  897.    Dim intResult        As Integer
  898.    Dim strResult        As String
  899.    Dim strDisplay       As String
  900.    Dim i                As Integer
  901.    Dim Str1             As String
  902.    Dim Str2             As String
  903.    intResult = 0
  904.    strResult = ""
  905.    strDisplay = ""
  906.      
  907.    Str1 = Text1.Text
  908.    Str2 = cReverse(Str1)
  909.    strDisplay = strDisplay & "Reverse of '" & Str1 & "' is " & vbCrLf & vbCrLf
  910.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  911.    strDisplay = strDisplay & "Reverse of '" & Str2 & "' is " & vbCrLf & vbCrLf
  912.    strDisplay = strDisplay & cReverse(Str2) & vbCrLf & vbCrLf
  913.    txt_Result = strDisplay
  914.    'time the function
  915.    TimerHandle = cTimerOpen()
  916.    TimerStartOk = cTimerStart(TimerHandle)
  917.    For i = 1 To Iteration
  918.       strResult = cReverse(Str1)
  919.    Next i
  920.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  921.    TimerCloseOk = cTimerClose(TimerHandle)
  922. End Sub
  923. Private Sub TestMixChars()
  924.    Dim intResult        As Integer
  925.    Dim strResult        As String
  926.    Dim strDisplay       As String
  927.    Dim i                As Integer
  928.    Dim Str1             As String
  929.    Dim Str2             As String
  930.    intResult = 0
  931.    strResult = ""
  932.    strDisplay = ""
  933.      
  934.    Str1 = Text1.Text
  935.    Str2 = cMixChars(Str1)
  936.    strDisplay = strDisplay & "MixChars of '" & Str1 & "' is " & vbCrLf & vbCrLf
  937.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  938.    strDisplay = strDisplay & "MixChars of '" & Str2 & "' is " & vbCrLf & vbCrLf
  939.    strDisplay = strDisplay & cMixChars(Str2) & vbCrLf & vbCrLf
  940.    Str1 = "TIME TO WIN (32-Bit)"
  941.    Str2 = cMixChars(Str1)
  942.    strDisplay = strDisplay & "MixChars of '" & Str1 & "' is " & vbCrLf & vbCrLf
  943.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  944.    strDisplay = strDisplay & "MixChars of '" & Str2 & "' is " & vbCrLf & vbCrLf
  945.    strDisplay = strDisplay & cMixChars(Str2) & vbCrLf & vbCrLf
  946.    Str1 = "Under the sky, the sun lights"
  947.    Str2 = cMixChars(Str1)
  948.    strDisplay = strDisplay & "MixChars of '" & Str1 & "' is " & vbCrLf & vbCrLf
  949.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  950.    strDisplay = strDisplay & "MixChars of '" & Str2 & "' is " & vbCrLf & vbCrLf
  951.    strDisplay = strDisplay & cMixChars(Str2)
  952.    txt_Result = strDisplay
  953.    'time the function
  954.    TimerHandle = cTimerOpen()
  955.    TimerStartOk = cTimerStart(TimerHandle)
  956.    For i = 1 To Iteration
  957.       strResult = cMixChars(Str1)
  958.    Next i
  959.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  960.    TimerCloseOk = cTimerClose(TimerHandle)
  961. End Sub
  962. Private Sub TestScrollX()
  963.    Dim intResult        As Integer
  964.    Dim strResult        As String
  965.    Dim strDisplay       As String
  966.    Dim i                As Integer
  967.    Dim Str1             As String
  968.    Dim Str2             As String
  969.    intResult = 0
  970.    strResult = ""
  971.    strDisplay = ""
  972.      
  973.    Str1 = Text1.Text
  974.    Str2 = Text1.Text
  975.    strDisplay = strDisplay & "Scroll 7 times from left into '" & Str1 & "' is " & vbCrLf & vbCrLf
  976.    For i = 1 To 7
  977.       Str2 = cScrollL(Str2)
  978.       strDisplay = strDisplay & Str2 & vbCrLf
  979.    Next i
  980.    strDisplay = strDisplay & vbCrLf
  981.    Str1 = Text1.Text
  982.    Str2 = Text1.Text
  983.    strDisplay = strDisplay & "Scroll 7 times from right into '" & Str1 & "' is " & vbCrLf & vbCrLf
  984.    For i = 1 To 7
  985.       Str2 = cScrollR(Str2)
  986.       strDisplay = strDisplay & Str2 & vbCrLf
  987.    Next i
  988.    strDisplay = strDisplay & vbCrLf
  989.    txt_Result = strDisplay
  990.    'time the function
  991.    TimerHandle = cTimerOpen()
  992.    TimerStartOk = cTimerStart(TimerHandle)
  993.    For i = 1 To Iteration
  994.       strResult = cScrollL(Str1)
  995.    Next i
  996.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  997.    TimerCloseOk = cTimerClose(TimerHandle)
  998. End Sub
  999. Private Sub TestChangeChars()
  1000.    Dim intResult        As Integer
  1001.    Dim strResult        As String
  1002.    Dim strDisplay       As String
  1003.    Dim i                As Integer
  1004.    Dim Str1             As String
  1005.    intResult = 0
  1006.    strResult = ""
  1007.    strDisplay = ""
  1008.      
  1009.    Str1 = Text1.Text
  1010.    strDisplay = strDisplay & "Change 'AZM' into 'qyc' of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1011.    Call cChangeChars(Str1, "AZM", "qyc")
  1012.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  1013.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1014.    strDisplay = strDisplay & "Change 'AZM' into 'qyc' of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1015.    Call cChangeChars(Str1, "AZM", "qyc")
  1016.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  1017.    strDisplay = strDisplay & "Change 'qyc' into '+-*' of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1018.    Call cChangeChars(Str1, "qyc", "+-*")
  1019.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  1020.    txt_Result = strDisplay
  1021.    'time the function
  1022.    Str1 = Text1.Text
  1023.    TimerHandle = cTimerOpen()
  1024.    TimerStartOk = cTimerStart(TimerHandle)
  1025.    For i = 1 To Iteration
  1026.       Call cChangeChars(Str1, "AZM", "qyc")
  1027.    Next i
  1028.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1029.    TimerCloseOk = cTimerClose(TimerHandle)
  1030. End Sub
  1031. Private Sub TestChangeCharsUntil()
  1032.    Dim intResult        As Integer
  1033.    Dim strResult        As String
  1034.    Dim strDisplay       As String
  1035.    Dim i                As Integer
  1036.    Dim Str1             As String
  1037.    intResult = 0
  1038.    strResult = ""
  1039.    strDisplay = ""
  1040.      
  1041.    Str1 = Text1.Text
  1042.    strDisplay = strDisplay & "Change 'AZM' into 'qyc' of '" & Str1 & "' until 'N' is " & vbCrLf & vbCrLf
  1043.    Call cChangeCharsUntil(Str1, "AZM", "qyc", "N")
  1044.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  1045.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1046.    strDisplay = strDisplay & "Change 'AZM' into 'qyc' of '" & Str1 & "' until 'N' is " & vbCrLf & vbCrLf
  1047.    Call cChangeCharsUntil(Str1, "AZM", "qyc", "N")
  1048.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  1049.    strDisplay = strDisplay & "Change 'qyc' into '+-*' of '" & Str1 & "' until 'N' is " & vbCrLf & vbCrLf
  1050.    Call cChangeCharsUntil(Str1, "qyc", "+-*", "N")
  1051.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  1052.    txt_Result = strDisplay
  1053.    'time the function
  1054.    Str1 = Text1.Text
  1055.    TimerHandle = cTimerOpen()
  1056.    TimerStartOk = cTimerStart(TimerHandle)
  1057.    For i = 1 To Iteration
  1058.       Call cChangeCharsUntil(Str1, "AZM", "qyc", "N")
  1059.    Next i
  1060.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1061.    TimerCloseOk = cTimerClose(TimerHandle)
  1062. End Sub
  1063. Private Sub TestCheckChars()
  1064.    Dim intResult        As Integer
  1065.    Dim strResult        As String
  1066.    Dim strDisplay       As String
  1067.    Dim i                As Integer
  1068.    Dim Str1             As String
  1069.    intResult = 0
  1070.    strResult = ""
  1071.    strDisplay = ""
  1072.      
  1073.    Str1 = Text1.Text
  1074.    strDisplay = strDisplay & "Check 'A','Z' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1075.    strDisplay = strDisplay & IIf(cCheckChars(Str1, "AZ"), "all present", "not all present") & vbCrLf & vbCrLf
  1076.    strDisplay = strDisplay & "Check 'a','Z' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1077.    strDisplay = strDisplay & IIf(cCheckChars(Str1, "aZ"), "all present", "not all present") & vbCrLf & vbCrLf
  1078.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1079.    strDisplay = strDisplay & "Check 'A','Z' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1080.    strDisplay = strDisplay & IIf(cCheckChars(Str1, "AZ"), "all present", "not all present") & vbCrLf & vbCrLf
  1081.    strDisplay = strDisplay & "Check 'a','Z' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1082.    strDisplay = strDisplay & IIf(cCheckChars(Str1, "aZ"), "all present", "not all present")
  1083.    txt_Result = strDisplay
  1084.    'time the function
  1085.    Str1 = Text1.Text
  1086.    TimerHandle = cTimerOpen()
  1087.    TimerStartOk = cTimerStart(TimerHandle)
  1088.    For i = 1 To Iteration
  1089.       intResult = cCheckChars(Str1, "aZ")
  1090.    Next i
  1091.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1092.    TimerCloseOk = cTimerClose(TimerHandle)
  1093. End Sub
  1094. Private Sub TestFilterChars()
  1095.    Dim intResult        As Integer
  1096.    Dim strResult        As String
  1097.    Dim strDisplay       As String
  1098.    Dim i                As Integer
  1099.    Dim Str1             As String
  1100.    intResult = 0
  1101.    strResult = ""
  1102.    strDisplay = ""
  1103.      
  1104.    Str1 = Text1.Text
  1105.    strDisplay = strDisplay & "Filter 'B','/' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1106.    strDisplay = strDisplay & cFilterChars(Str1, "B/") & vbCrLf & vbCrLf
  1107.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1108.    strDisplay = strDisplay & "Filter 'B','Y' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1109.    strDisplay = strDisplay & cFilterChars(Str1, "BY")
  1110.    txt_Result = strDisplay
  1111.    'time the function
  1112.    Str1 = Text1.Text
  1113.    TimerHandle = cTimerOpen()
  1114.    TimerStartOk = cTimerStart(TimerHandle)
  1115.    For i = 1 To Iteration
  1116.       strResult = cFilterChars(Str1, "B/")
  1117.    Next i
  1118.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1119.    TimerCloseOk = cTimerClose(TimerHandle)
  1120. End Sub
  1121. Private Sub TestFilterNotChars()
  1122.    Dim intResult        As Integer
  1123.    Dim strResult        As String
  1124.    Dim strDisplay       As String
  1125.    Dim i                As Integer
  1126.    Dim Str1             As String
  1127.    intResult = 0
  1128.    strResult = ""
  1129.    strDisplay = ""
  1130.      
  1131.    Str1 = Text1.Text
  1132.    strDisplay = strDisplay & "Filter not 'B','/' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1133.    strDisplay = strDisplay & cFilterNotChars(Str1, "B/") & vbCrLf & vbCrLf
  1134.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1135.    strDisplay = strDisplay & "Filter not 'B','Y' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1136.    strDisplay = strDisplay & cFilterNotChars(Str1, "BY")
  1137.    txt_Result = strDisplay
  1138.    'time the function
  1139.    Str1 = Text1.Text
  1140.    TimerHandle = cTimerOpen()
  1141.    TimerStartOk = cTimerStart(TimerHandle)
  1142.    For i = 1 To Iteration
  1143.       strResult = cFilterNotChars(Str1, "B/")
  1144.    Next i
  1145.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1146.    TimerCloseOk = cTimerClose(TimerHandle)
  1147. End Sub
  1148. Private Sub TestFilterBlocks()
  1149.    Dim intResult        As Integer
  1150.    Dim strResult        As String
  1151.    Dim strDisplay       As String
  1152.    Dim i                As Integer
  1153.    Dim Str1             As String
  1154.    intResult = 0
  1155.    strResult = ""
  1156.    strDisplay = ""
  1157.      
  1158.    Str1 = Text1.Text
  1159.    strDisplay = strDisplay & "Filter blocks between '/' and '/' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1160.    strDisplay = strDisplay & "'" & cFilterBlocks(Str1, "//") & "'" & vbCrLf & vbCrLf
  1161.    strDisplay = strDisplay & "Filter blocks between 'B' and 'I' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1162.    strDisplay = strDisplay & "'" & cFilterBlocks(Str1, "BI") & "'" & vbCrLf & vbCrLf
  1163.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1164.    strDisplay = strDisplay & "Filter blocks between '/' and '/' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1165.    strDisplay = strDisplay & "'" & cFilterBlocks(Str1, "//") & "'" & vbCrLf & vbCrLf
  1166.    strDisplay = strDisplay & "Filter blocks between 'B' and 'I' in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1167.    strDisplay = strDisplay & "'" & cFilterBlocks(Str1, "BI") & "'"
  1168.    txt_Result = strDisplay
  1169.    'time the function
  1170.    Str1 = Text1.Text
  1171.    TimerHandle = cTimerOpen()
  1172.    TimerStartOk = cTimerStart(TimerHandle)
  1173.    For i = 1 To Iteration
  1174.       strResult = cFilterBlocks(Str1, "BI")
  1175.    Next i
  1176.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1177.    TimerCloseOk = cTimerClose(TimerHandle)
  1178. End Sub
  1179. Private Sub TestResizeString()
  1180.    Dim intResult        As Integer
  1181.    Dim strResult        As String
  1182.    Dim strDisplay       As String
  1183.    Dim i                As Integer
  1184.    Dim Str1             As String
  1185.    intResult = 0
  1186.    strResult = ""
  1187.    strDisplay = ""
  1188.      
  1189.    Str1 = Text1.Text
  1190.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 5 chars is " & vbCrLf & vbCrLf
  1191.    strDisplay = strDisplay & "'" & cResizeString(Str1, 5) & "'" & vbCrLf & vbCrLf
  1192.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 10 chars is " & vbCrLf & vbCrLf
  1193.    strDisplay = strDisplay & "'" & cResizeString(Str1, 10) & "'" & vbCrLf & vbCrLf
  1194.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 50 chars is " & vbCrLf & vbCrLf
  1195.    strDisplay = strDisplay & "'" & cResizeString(Str1, 50) & "'" & vbCrLf & vbCrLf
  1196.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to -1 chars is " & vbCrLf & vbCrLf
  1197.    strDisplay = strDisplay & "'" & cResizeString(Str1, -1) & "'" & vbCrLf & vbCrLf
  1198.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1199.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 5 chars is " & vbCrLf & vbCrLf
  1200.    strDisplay = strDisplay & "'" & cResizeString(Str1, 5) & "'" & vbCrLf & vbCrLf
  1201.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 10 chars is " & vbCrLf & vbCrLf
  1202.    strDisplay = strDisplay & "'" & cResizeString(Str1, 10) & "'" & vbCrLf & vbCrLf
  1203.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 50 chars is " & vbCrLf & vbCrLf
  1204.    strDisplay = strDisplay & "'" & cResizeString(Str1, 50) & "'" & vbCrLf & vbCrLf
  1205.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to -1 chars is " & vbCrLf & vbCrLf
  1206.    strDisplay = strDisplay & "'" & cResizeString(Str1, -1) & "'"
  1207.    txt_Result = strDisplay
  1208.    'time the function
  1209.    Str1 = Text1.Text
  1210.    TimerHandle = cTimerOpen()
  1211.    TimerStartOk = cTimerStart(TimerHandle)
  1212.    For i = 1 To Iteration
  1213.       strResult = cResizeString(Str1, 5)
  1214.    Next i
  1215.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1216.    TimerCloseOk = cTimerClose(TimerHandle)
  1217. End Sub
  1218. Private Sub TestResizeStringAndFill()
  1219.    Dim intResult        As Integer
  1220.    Dim strResult        As String
  1221.    Dim strDisplay       As String
  1222.    Dim i                As Integer
  1223.    Dim Str1             As String
  1224.    intResult = 0
  1225.    strResult = ""
  1226.    strDisplay = ""
  1227.      
  1228.    Str1 = Text1.Text
  1229.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 5 chars is " & vbCrLf & vbCrLf
  1230.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, 5, "*") & "'" & vbCrLf & vbCrLf
  1231.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 10 chars is " & vbCrLf & vbCrLf
  1232.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, 10, "*") & "'" & vbCrLf & vbCrLf
  1233.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 50 chars is " & vbCrLf & vbCrLf
  1234.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, 50, "*") & "'" & vbCrLf & vbCrLf
  1235.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to -1 chars is " & vbCrLf & vbCrLf
  1236.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, -1, "*") & "'" & vbCrLf & vbCrLf
  1237.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1238.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 5 chars is " & vbCrLf & vbCrLf
  1239.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, 5, "*") & "'" & vbCrLf & vbCrLf
  1240.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 10 chars is " & vbCrLf & vbCrLf
  1241.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, 10, "*") & "'" & vbCrLf & vbCrLf
  1242.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to 50 chars is " & vbCrLf & vbCrLf
  1243.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, 50, "*") & "'" & vbCrLf & vbCrLf
  1244.    strDisplay = strDisplay & "'" & Str1 & "' resized from " & Len(Str1) & " to -1 chars is " & vbCrLf & vbCrLf
  1245.    strDisplay = strDisplay & "'" & cResizeStringAndFill(Str1, -1, "*") & "'"
  1246.    txt_Result = strDisplay
  1247.    'time the function
  1248.    Str1 = Text1.Text
  1249.    TimerHandle = cTimerOpen()
  1250.    TimerStartOk = cTimerStart(TimerHandle)
  1251.    For i = 1 To Iteration
  1252.       strResult = cResizeStringAndFill(Str1, 50, "*")
  1253.    Next i
  1254.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1255.    TimerCloseOk = cTimerClose(TimerHandle)
  1256. End Sub
  1257. Private Sub TestCreateAndFill()
  1258.    Dim intResult        As Integer
  1259.    Dim strResult        As String
  1260.    Dim strDisplay       As String
  1261.    Dim i                As Integer
  1262.    Dim Str1             As String
  1263.    intResult = 0
  1264.    strResult = ""
  1265.    strDisplay = ""
  1266.      
  1267.    Str1 = Text1.Text
  1268.    strDisplay = strDisplay & "Create and Fill a string of 60 chars with '" & Str1 & "' is " & vbCrLf & vbCrLf
  1269.    strDisplay = strDisplay & "'" & cCreateAndFill(60, Str1) & "'" & vbCrLf & vbCrLf
  1270.    strDisplay = strDisplay & "Create and Fill a string of 40 chars with '" & Str1 & "' is " & vbCrLf & vbCrLf
  1271.    strDisplay = strDisplay & "'" & cCreateAndFill(40, Str1) & "'" & vbCrLf & vbCrLf
  1272.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1273.    strDisplay = strDisplay & "Create and Fill a string of 60 chars with '" & Str1 & "' is " & vbCrLf & vbCrLf
  1274.    strDisplay = strDisplay & "'" & cCreateAndFill(60, Str1) & "'" & vbCrLf & vbCrLf
  1275.    strDisplay = strDisplay & "Create and Fill a string of 40 chars with '" & Str1 & "' is " & vbCrLf & vbCrLf
  1276.    strDisplay = strDisplay & "'" & cCreateAndFill(40, Str1) & "'"
  1277.    txt_Result = strDisplay
  1278.    'time the function
  1279.    Str1 = Text1.Text
  1280.    TimerHandle = cTimerOpen()
  1281.    TimerStartOk = cTimerStart(TimerHandle)
  1282.    For i = 1 To Iteration
  1283.       strResult = cCreateAndFill(40, Str1)
  1284.    Next i
  1285.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1286.    TimerCloseOk = cTimerClose(TimerHandle)
  1287. End Sub
  1288. Private Sub TestFill()
  1289.    Dim intResult        As Integer
  1290.    Dim strResult        As String
  1291.    Dim strDisplay       As String
  1292.    Dim i                As Integer
  1293.    Dim Str1             As String
  1294.    intResult = 0
  1295.    strResult = ""
  1296.    strDisplay = ""
  1297.      
  1298.    Str1 = Text1.Text
  1299.    strDisplay = strDisplay & "Fill of '" & Str1 & "' with '*=' is " & vbCrLf & vbCrLf
  1300.    Call cFill(Str1, "*=")
  1301.    strDisplay = strDisplay & "'" & Str1 & "'" & vbCrLf & vbCrLf
  1302.    strDisplay = strDisplay & "Fill of '" & Str1 & "' with '=*=' is " & vbCrLf & vbCrLf
  1303.    Call cFill(Str1, "=*=")
  1304.    strDisplay = strDisplay & "'" & Str1 & "'" & vbCrLf & vbCrLf
  1305.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1306.    strDisplay = strDisplay & "Fill of '" & Str1 & "' with '7516' is " & vbCrLf & vbCrLf
  1307.    Call cFill(Str1, "7516")
  1308.    strDisplay = strDisplay & "'" & Str1 & "'" & vbCrLf & vbCrLf
  1309.    strDisplay = strDisplay & "Fill of '" & Str1 & "' with '$61.00' is " & vbCrLf & vbCrLf
  1310.    Call cFill(Str1, "$61.00")
  1311.    strDisplay = strDisplay & "'" & Str1 & "'"
  1312.    txt_Result = strDisplay
  1313.    'time the function
  1314.    Str1 = Text1.Text
  1315.    TimerHandle = cTimerOpen()
  1316.    TimerStartOk = cTimerStart(TimerHandle)
  1317.    For i = 1 To Iteration
  1318.       Call cFill(Str1, "*=")
  1319.    Next i
  1320.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1321.    TimerCloseOk = cTimerClose(TimerHandle)
  1322. End Sub
  1323. Private Sub TestLrc()
  1324.    Dim intResult        As Integer
  1325.    Dim strResult        As String
  1326.    Dim strDisplay       As String
  1327.    Dim i                As Integer
  1328.    Dim Str1             As String
  1329.    intResult = 0
  1330.    strResult = ""
  1331.    strDisplay = ""
  1332.      
  1333.    Str1 = Text1.Text
  1334.    strDisplay = strDisplay & "Lrc for '" & Str1 & "' is '" & cLrc(Str1) & "'" & vbCrLf & vbCrLf
  1335.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1336.    strDisplay = strDisplay & "Lrc for '" & Str1 & "' is '" & cLrc(Str1) & "'" & vbCrLf & vbCrLf
  1337.    Str1 = Chr$(2) & "0a12721536"
  1338.    strDisplay = strDisplay & "Lrc for '" & Str1 & "' is '" & cLrc(Str1) & "'"
  1339.    txt_Result = strDisplay
  1340.    'time the function
  1341.    Str1 = Text1.Text
  1342.    TimerHandle = cTimerOpen()
  1343.    TimerStartOk = cTimerStart(TimerHandle)
  1344.    For i = 1 To Iteration
  1345.       strResult = cLrc(Str1)
  1346.    Next i
  1347.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1348.    TimerCloseOk = cTimerClose(TimerHandle)
  1349. End Sub
  1350. Private Sub TestCompress()
  1351.    Dim intResult        As Integer
  1352.    Dim strResult        As String
  1353.    Dim strDisplay       As String
  1354.    Dim i                As Integer
  1355.    Dim Str1             As String
  1356.    intResult = 0
  1357.    strResult = ""
  1358.    strDisplay = ""
  1359.      
  1360.    Str1 = Text1.Text
  1361.    strDisplay = strDisplay & "Filter chr(0),chr(9),chr(32) in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1362.    strDisplay = strDisplay & "'" & cCompress(Str1) & "'" & vbCrLf & vbCrLf
  1363.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1364.    strDisplay = strDisplay & "Filter chr(0),chr(9),chr(32) in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1365.    strDisplay = strDisplay & "'" & cCompress(Str1) & "'" & vbCrLf & vbCrLf
  1366.    Str1 = "A " & Chr$(9) & "BC  "
  1367.    strDisplay = strDisplay & "Filter chr(0),chr(9),chr(32) in '" & Str1 & "' is " & vbCrLf & vbCrLf
  1368.    strDisplay = strDisplay & "'" & cCompress(Str1) & "'" & vbCrLf & vbCrLf
  1369.    txt_Result = strDisplay
  1370.    'time the function
  1371.    Str1 = Text1.Text
  1372.    TimerHandle = cTimerOpen()
  1373.    TimerStartOk = cTimerStart(TimerHandle)
  1374.    For i = 1 To Iteration
  1375.       strResult = cCompress(Str1)
  1376.    Next i
  1377.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1378.    TimerCloseOk = cTimerClose(TimerHandle)
  1379. End Sub
  1380. Public Sub TestCompressTab()
  1381.    Dim intResult        As Integer
  1382.    Dim strResult        As String
  1383.    Dim strDisplay       As String
  1384.    Dim i                As Integer
  1385.    Dim Str1             As String
  1386.    Dim Str2             As String
  1387.    Dim Str3             As String
  1388.    intResult = 0
  1389.    strResult = ""
  1390.    strDisplay = ""
  1391.      
  1392.    Str1 = "A      BC   DEF  GHIJ  "
  1393.    For i = 1 To 6
  1394.       Str2 = cCompressTab(Str1, i)
  1395.       Str3 = Str2
  1396.       Call cChangeChars(Str3, vbTab, "
  1397.       strDisplay = strDisplay & "Compress tab (" & i & " chars) into '" & Str1 & "' is '" & Str3 & "'" & vbCrLf
  1398.       strDisplay = strDisplay & "Expand tab (" & i & " chars) into '" & Str3 & "' is '" & cExpandTab(Str2, i) & "'" & vbCrLf & vbCrLf
  1399.    Next i
  1400.    txt_Result = strDisplay
  1401.    'time the function
  1402.    Str1 = Text1.Text
  1403.    TimerHandle = cTimerOpen()
  1404.    TimerStartOk = cTimerStart(TimerHandle)
  1405.    For i = 1 To Iteration
  1406.       strResult = cCompressTab(Str1, 3)
  1407.    Next i
  1408.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1409.    TimerCloseOk = cTimerClose(TimerHandle)
  1410. End Sub
  1411. Private Sub TestCompact()
  1412.    Dim intResult        As Integer
  1413.    Dim strResult        As String
  1414.    Dim strDisplay       As String
  1415.    Dim i                As Integer
  1416.    Dim Str1             As String
  1417.    Dim Str2             As String
  1418.    intResult = 0
  1419.    strResult = ""
  1420.    strDisplay = ""
  1421.      
  1422.    Str1 = "987654321"
  1423.    Str2 = cCompact(Str1)
  1424.    strDisplay = strDisplay & "Compact '" & Str1 & "' is '" & Str2 & "'" & vbCrLf & vbCrLf
  1425.    strDisplay = strDisplay & "Uncompact '" & Str2 & "' is '" & cUncompact(Str2) & "'" & vbCrLf & vbCrLf
  1426.    Str1 = "1234567890"
  1427.    Str2 = cCompact(Str1)
  1428.    strDisplay = strDisplay & "Compact '" & Str1 & "' is '" & Str2 & "'" & vbCrLf & vbCrLf
  1429.    strDisplay = strDisplay & "Uncompact '" & Str2 & "' is '" & cUncompact(Str2) & "'" & vbCrLf & vbCrLf
  1430.    Str1 = Text1.Text
  1431.    Str2 = cCompact(Str1)
  1432.    strDisplay = strDisplay & "Compact '" & Str1 & "' is '" & Str2 & "'" & vbCrLf & vbCrLf
  1433.    strDisplay = strDisplay & "Uncompact '" & Str2 & "' is '" & cUncompact(Str2) & "'" & vbCrLf & vbCrLf
  1434.    txt_Result = strDisplay
  1435.    'time the function
  1436.    Str1 = Text1.Text
  1437.    TimerHandle = cTimerOpen()
  1438.    TimerStartOk = cTimerStart(TimerHandle)
  1439.    For i = 1 To Iteration
  1440.       strResult = cCompact(Str1)
  1441.    Next i
  1442.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1443.    TimerCloseOk = cTimerClose(TimerHandle)
  1444. End Sub
  1445. Private Sub TestAlign()
  1446.    Dim intResult        As Integer
  1447.    Dim strResult        As String
  1448.    Dim strDisplay       As String
  1449.    Dim i                As Integer
  1450.    Dim Str1             As String
  1451.    Dim Str2             As String
  1452.    intResult = 0
  1453.    strResult = ""
  1454.    strDisplay = ""
  1455.      
  1456.    Str1 = "T2WIN-32"
  1457.    strDisplay = strDisplay & "Left Align of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1458.    strDisplay = strDisplay & "'" & cAlign(Str1, -1, 30) & "'" & vbCrLf & vbCrLf
  1459.    strDisplay = strDisplay & "Center Align of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1460.    strDisplay = strDisplay & "'" & cAlign(Str1, 0, 30) & "'" & vbCrLf & vbCrLf
  1461.    strDisplay = strDisplay & "Right Align of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1462.    strDisplay = strDisplay & "'" & cAlign(Str1, 1, 30) & "'" & vbCrLf & vbCrLf
  1463.    Str1 = Text1.Text
  1464.    strDisplay = strDisplay & "Left Align of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1465.    strDisplay = strDisplay & "'" & cAlign(Str1, -1, 50) & "'" & vbCrLf & vbCrLf
  1466.    strDisplay = strDisplay & "Center Align of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1467.    strDisplay = strDisplay & "'" & cAlign(Str1, 0, 50) & "'" & vbCrLf & vbCrLf
  1468.    strDisplay = strDisplay & "Right Align of '" & Str1 & "' is " & vbCrLf & vbCrLf
  1469.    strDisplay = strDisplay & "'" & cAlign(Str1, 1, 50) & "'"
  1470.    txt_Result = strDisplay
  1471.    'time the function
  1472.    Str1 = Text1.Text
  1473.    TimerHandle = cTimerOpen()
  1474.    TimerStartOk = cTimerStart(TimerHandle)
  1475.    For i = 1 To Iteration
  1476.       strResult = cAlign(Str1, 1, 30)
  1477.    Next i
  1478.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1479.    TimerCloseOk = cTimerClose(TimerHandle)
  1480. End Sub
  1481. Private Sub TestProperName()
  1482.    Dim intResult        As Integer
  1483.    Dim strResult        As String
  1484.    Dim strDisplay       As String
  1485.    Dim i                As Integer
  1486.    Dim Str1             As String
  1487.    Dim Str2             As String
  1488.    intResult = 0
  1489.    strResult = ""
  1490.    strDisplay = ""
  1491.      
  1492.    Str1 = Text1.Text
  1493.    strDisplay = strDisplay + "ProperName of '" & Str1 & "' is " & cProperName(Str1) & vbCrLf & vbCrLf
  1494.    Str1 = "John fitz,jr"
  1495.    strDisplay = strDisplay + "ProperName of '" & Str1 & "' is " & cProperName(Str1) & vbCrLf & vbCrLf
  1496.    Str1 = "john Fitz, jr"
  1497.    strDisplay = strDisplay + "ProperName of '" & Str1 & "' is " & cProperName(Str1) & vbCrLf & vbCrLf
  1498.    Str1 = "macdonald"
  1499.    strDisplay = strDisplay + "ProperName of '" & Str1 & "' is " & cProperName(Str1) & vbCrLf & vbCrLf
  1500.    Str1 = "mac donald"
  1501.    strDisplay = strDisplay + "ProperName of '" & Str1 & "' is " & cProperName(Str1)
  1502.                   
  1503.    txt_Result = strDisplay
  1504.    'time the function
  1505.    Str1 = Text1.Text
  1506.    TimerHandle = cTimerOpen()
  1507.    TimerStartOk = cTimerStart(TimerHandle)
  1508.    For i = 1 To Iteration
  1509.       strResult = cProperName(Str1)
  1510.    Next i
  1511.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1512.    TimerCloseOk = cTimerClose(TimerHandle)
  1513. End Sub
  1514. Private Sub TestProperName2()
  1515.    Dim intResult        As Integer
  1516.    Dim strResult        As String
  1517.    Dim strDisplay       As String
  1518.    Dim i                As Integer
  1519.    Dim Str1             As String
  1520.    Dim Str2             As String
  1521.    intResult = 0
  1522.    strResult = ""
  1523.    strDisplay = ""
  1524.      
  1525.    Str1 = Text1.Text
  1526.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "", 0) & "'" & vbCrLf & vbCrLf
  1527.    Str1 = "JOHN FITZ,JR"
  1528.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "", PN_UPPERCASE Or PN_PUNCTUATION) & "'" & vbCrLf & vbCrLf
  1529.    Str1 = "john Fitz,jr"
  1530.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "", PN_PUNCTUATION) & "'" & vbCrLf & vbCrLf
  1531.    Str1 = "macdonald"
  1532.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "", 0) & "'" & vbCrLf & vbCrLf
  1533.    Str1 = "mac donald"
  1534.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "", 0) & "'" & vbCrLf & vbCrLf
  1535.    Str1 = "a.l. greene jr."
  1536.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "", PN_PUNCTUATION) & "'" & vbCrLf & vbCrLf
  1537.    Str1 = "shale and sandstone and till"
  1538.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "the/of/a/an/and", PN_PUNCTUATION) & "'" & vbCrLf & vbCrLf
  1539.    Str1 = "a sandstone or a shale"
  1540.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "the/or/of/a/an/and", PN_PUNCTUATION) & "'" & vbCrLf & vbCrLf
  1541.    Str1 = "RR2 BARRHEAD"
  1542.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "rr2", PN_UPPERCASE Or PN_PUNCTUATION Or PN_KEEP_ORIGINAL) & "'" & vbCrLf & vbCrLf
  1543.    Str1 = "ANDY MACDONALD"
  1544.    strDisplay = strDisplay + "ProperName2 of '" & Str1 & "' is '" & cProperName2(Str1, "mac", PN_UPPERCASE Or PN_PUNCTUATION Or PN_KEEP_ORIGINAL Or PN_ONLY_LEADER_SPACE) & "'"
  1545.                   
  1546.    txt_Result = strDisplay
  1547.    'time the function
  1548.    Str1 = Text1.Text
  1549.    TimerHandle = cTimerOpen()
  1550.    TimerStartOk = cTimerStart(TimerHandle)
  1551.    For i = 1 To Iteration
  1552.       strResult = cProperName2(Str1, "", 0)
  1553.    Next i
  1554.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1555.    TimerCloseOk = cTimerClose(TimerHandle)
  1556. End Sub
  1557. Private Sub TestStringSAR()
  1558.    Dim intResult        As Integer
  1559.    Dim strResult        As String
  1560.    Dim strDisplay       As String
  1561.    Dim i                As Integer
  1562.    Dim Str1             As String
  1563.    Dim Str2             As String
  1564.    intResult = 0
  1565.    strResult = ""
  1566.    strDisplay = ""
  1567.      
  1568.    Str1 = "T2WIN-32, T2WIN-32, T2WIN-32, T2WIN-32 IS A DLL"
  1569.    Str2 = cStringSAR(Str1, "T2WIN-32", "t2win-32", False)
  1570.    strDisplay = strDisplay & "Replace 'T2WIN-32' by 't2win-32'" & vbCrLf
  1571.    strDisplay = strDisplay & "     in" & vbCrLf
  1572.    strDisplay = strDisplay & Str1 & vbCrLf
  1573.    strDisplay = strDisplay & "     is" & vbCrLf
  1574.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  1575.    Str2 = cStringSAR(Str1, "2W", "IME TO W", True)
  1576.    strDisplay = strDisplay & "Replace '2W' by 'IME TO W'" & vbCrLf
  1577.    strDisplay = strDisplay & "     in" & vbCrLf
  1578.    strDisplay = strDisplay & Str1 & vbCrLf
  1579.    strDisplay = strDisplay & "     is" & vbCrLf
  1580.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  1581.    Str2 = cStringSAR(Str1, "T2WIN-32", "", True)
  1582.    strDisplay = strDisplay & "Replace 'T2WIN-32, ' by ''" & vbCrLf
  1583.    strDisplay = strDisplay & "     in" & vbCrLf
  1584.    strDisplay = strDisplay & Str1 & vbCrLf
  1585.    strDisplay = strDisplay & "     is" & vbCrLf
  1586.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  1587.    Str2 = cStringSAR(Str1, "I", "i", False)
  1588.    strDisplay = strDisplay & "Replace 'I' by 'i'" & vbCrLf
  1589.    strDisplay = strDisplay & "     in" & vbCrLf
  1590.    strDisplay = strDisplay & Str1 & vbCrLf
  1591.    strDisplay = strDisplay & "     is" & vbCrLf
  1592.    strDisplay = strDisplay & Str2 & vbCrLf & vbCrLf
  1593.    txt_Result = strDisplay
  1594.    'time the function
  1595.    Str1 = Text1.Text
  1596.    TimerHandle = cTimerOpen()
  1597.    TimerStartOk = cTimerStart(TimerHandle)
  1598.    For i = 1 To Iteration
  1599.       strResult = cStringSAR(Str1, "T2WIN-32", "t2win-32", False)
  1600.    Next i
  1601.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1602.    TimerCloseOk = cTimerClose(TimerHandle)
  1603. End Sub
  1604. Private Sub TestToHexa()
  1605.    Dim intResult        As Integer
  1606.    Dim strResult        As String
  1607.    Dim strDisplay       As String
  1608.    Dim i                As Integer
  1609.    Dim Str1             As String
  1610.    Dim Str2             As String
  1611.    intResult = 0
  1612.    strResult = ""
  1613.    strDisplay = ""
  1614.    Str1 = Text1.Text
  1615.    Str2 = cToHexa(Str1)
  1616.    strDisplay = strDisplay & "To Hexa of '" & Str1 & "' is" & vbCrLf & vbCrLf
  1617.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1618.    strDisplay = strDisplay & "From Hexa of '" & Str2 & "' is" & vbCrLf & vbCrLf
  1619.    strDisplay = strDisplay & "'" & cFromHexa(Str2) & "'" & vbCrLf & vbCrLf
  1620.    Str1 = "ABCDEFGH"
  1621.    Str2 = cToHexa(Str1)
  1622.    strDisplay = strDisplay & "To Hexa of '" & Str1 & "' is" & vbCrLf & vbCrLf
  1623.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1624.    strDisplay = strDisplay & "From Hexa of '" & Str2 & "' is" & vbCrLf & vbCrLf
  1625.    strDisplay = strDisplay & "'" & cFromHexa(Str2) & "'" & vbCrLf & vbCrLf
  1626.    Str1 = "01234567890"
  1627.    Str2 = cToHexa(Str1)
  1628.    strDisplay = strDisplay & "To Hexa of '" & Str1 & "' is" & vbCrLf & vbCrLf
  1629.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1630.    strDisplay = strDisplay & "From Hexa of '" & Str2 & "' is" & vbCrLf & vbCrLf
  1631.    strDisplay = strDisplay & "'" & cFromHexa(Str2) & "'"
  1632.    txt_Result = strDisplay
  1633.    'time the function
  1634.    Str1 = Text1.Text
  1635.    TimerHandle = cTimerOpen()
  1636.    TimerStartOk = cTimerStart(TimerHandle)
  1637.    For i = 1 To Iteration
  1638.       strResult = cToHexa(Str1)
  1639.    Next i
  1640.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1641.    TimerCloseOk = cTimerClose(TimerHandle)
  1642. End Sub
  1643. Private Sub TestRomanArabic()
  1644.    Dim intResult        As Integer
  1645.    Dim strResult        As String
  1646.    Dim strDisplay       As String
  1647.    Dim i                As Integer
  1648.    Dim Str1             As String
  1649.    Dim Value            As Integer
  1650.    intResult = 0
  1651.    strResult = ""
  1652.    strDisplay = ""
  1653.    Str1 = UCase$(cArabicToRoman(Year(Int(Now))))
  1654.    strDisplay = strDisplay & Str1 & " in Arabic is " & cRomanToArabic(LCase$(Str1)) & vbCrLf & vbCrLf
  1655.    Str1 = UCase$(cArabicToRoman(Year(Int(Now)) - 1))
  1656.    strDisplay = strDisplay & Str1 & " in Arabic is " & cRomanToArabic(LCase$(Str1)) & vbCrLf & vbCrLf
  1657.    Str1 = UCase$(cArabicToRoman(Year(Int(Now)) + 1))
  1658.    strDisplay = strDisplay & Str1 & " in Arabic is " & cRomanToArabic(LCase$(Str1)) & vbCrLf & vbCrLf
  1659.    Value = Year(Int(Now))
  1660.    strDisplay = strDisplay & Value & " in Roman is " & UCase$(cArabicToRoman(Value)) & vbCrLf & vbCrLf
  1661.    Value = Year(Int(Now)) - 1
  1662.    strDisplay = strDisplay & Value & " in Roman is " & UCase$(cArabicToRoman(Value)) & vbCrLf & vbCrLf
  1663.    Value = Year(Int(Now)) + 1
  1664.    strDisplay = strDisplay & Value & " in Roman is " & UCase$(cArabicToRoman(Value)) & vbCrLf & vbCrLf
  1665.    txt_Result = strDisplay
  1666.    'time the function
  1667.    Str1 = Text1.Text
  1668.    TimerHandle = cTimerOpen()
  1669.    TimerStartOk = cTimerStart(TimerHandle)
  1670.    For i = 1 To Iteration
  1671.       strResult = cArabicToRoman(1996)
  1672.    Next i
  1673.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1674.    TimerCloseOk = cTimerClose(TimerHandle)
  1675. End Sub
  1676. Private Sub TestAsciiEbcdic()
  1677.    Dim intResult        As Integer
  1678.    Dim strResult        As String
  1679.    Dim strDisplay       As String
  1680.    Dim i                As Integer
  1681.    Dim Str1             As String
  1682.    Dim Str2             As String
  1683.    intResult = 0
  1684.    strResult = ""
  1685.    strDisplay = ""
  1686.    Str1 = Text1.Text
  1687.    Str2 = Str1
  1688.    Call cCnvASCIItoEBCDIC(Str2)
  1689.    strDisplay = strDisplay & "To EBCDIC of '" & Str1 & "' is" & vbCrLf & vbCrLf
  1690.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1691.    strDisplay = strDisplay & "To ASCII of '" & Str2 & "' is" & vbCrLf & vbCrLf
  1692.    Call cCnvEBCDICtoASCII(Str2)
  1693.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1694.    Str1 = "ABCDEFGH"
  1695.    Str2 = Str1
  1696.    Call cCnvASCIItoEBCDIC(Str2)
  1697.    strDisplay = strDisplay & "To EBCDIC of '" & Str1 & "' is" & vbCrLf & vbCrLf
  1698.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1699.    strDisplay = strDisplay & "To ASCII of '" & Str2 & "' is" & vbCrLf & vbCrLf
  1700.    Call cCnvEBCDICtoASCII(Str2)
  1701.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1702.    Str1 = "01234567890"
  1703.    Str2 = Str1
  1704.    Call cCnvASCIItoEBCDIC(Str2)
  1705.    strDisplay = strDisplay & "To EBCDIC of '" & Str1 & "' is" & vbCrLf & vbCrLf
  1706.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  1707.    strDisplay = strDisplay & "To ASCII of '" & Str2 & "' is" & vbCrLf & vbCrLf
  1708.    Call cCnvEBCDICtoASCII(Str2)
  1709.    strDisplay = strDisplay & "'" & Str2 & "'"
  1710.    txt_Result = strDisplay
  1711.    'time the function
  1712.    Str1 = Text1.Text
  1713.    TimerHandle = cTimerOpen()
  1714.    TimerStartOk = cTimerStart(TimerHandle)
  1715.    For i = 1 To Iteration
  1716.       Call cCnvASCIItoEBCDIC(Str1)
  1717.    Next i
  1718.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1719.    TimerCloseOk = cTimerClose(TimerHandle)
  1720. End Sub
  1721. Private Sub TestPatternMatch()
  1722.    Dim intResult        As Integer
  1723.    Dim strResult        As String
  1724.    Dim strDisplay       As String
  1725.    Dim i                As Integer
  1726.    Dim Str1             As String
  1727.    Dim Str2             As String
  1728.    intResult = 0
  1729.    strResult = ""
  1730.    strDisplay = ""
  1731.    Str1 = "Under the blue sky, the sun lights"
  1732.    strDisplay = "PatternMatch '" & Str1 & "' with" & vbCrLf & vbCrLf
  1733.    Str2 = "*"
  1734.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1735.    Str2 = "*??*???*?"
  1736.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1737.    Str2 = "*Under*"
  1738.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1739.    Str2 = "*sky*"
  1740.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1741.    Str2 = "*lights"
  1742.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1743.    Str2 = "??der*sky*ligh??*"
  1744.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1745.    Str2 = "Under?the * s??,*"
  1746.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf & vbCrLf
  1747.    Str2 = "*under*"
  1748.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1749.    Str2 = "Under*sun"
  1750.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf
  1751.    Str2 = "Under t??e*"
  1752.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatch(Str1, Str2) & vbCrLf & vbCrLf
  1753.    strDisplay = strDisplay & "PatternMatchS (case insensitive) '" & Str1 & "' with" & vbCrLf & vbCrLf
  1754.    Str2 = "*"
  1755.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1756.    Str2 = "*??*???*?"
  1757.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1758.    Str2 = "*Under*"
  1759.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1760.    Str2 = "*sky*"
  1761.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1762.    Str2 = "*lights"
  1763.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1764.    Str2 = "??der*sky*ligh??*"
  1765.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1766.    Str2 = "Under?the * s??,*"
  1767.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf & vbCrLf
  1768.    Str2 = "*under*"
  1769.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1770.    Str2 = "Under*sun"
  1771.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf
  1772.    Str2 = "Under t??e*"
  1773.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternMatchS(Str1, Str2, False) & vbCrLf & vbCrLf
  1774.    txt_Result = strDisplay
  1775.    'time the function
  1776.    Str2 = "Under?the * s??,*"
  1777.    TimerHandle = cTimerOpen()
  1778.    TimerStartOk = cTimerStart(TimerHandle)
  1779.    For i = 1 To Iteration
  1780.       intResult = cPatternMatch(Str1, Str2)
  1781.    Next i
  1782.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1783.    TimerCloseOk = cTimerClose(TimerHandle)
  1784. End Sub
  1785. Private Sub TestPatternExtMatch()
  1786.    Dim intResult        As Integer
  1787.    Dim strResult        As String
  1788.    Dim strDisplay       As String
  1789.    Dim i                As Integer
  1790.    Dim Str1             As String
  1791.    Dim Str2             As String
  1792.    intResult = 0
  1793.    strResult = ""
  1794.    strDisplay = ""
  1795.    Str1 = "Under the blue sky, the sun lights"
  1796.    strDisplay = "PatternExtMatch '" & Str1 & "' with" & vbCrLf & vbCrLf
  1797.    Str2 = "*"
  1798.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1799.    Str2 = "*??*???*?"
  1800.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1801.    Str2 = "*Under*"
  1802.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1803.    Str2 = "*sky*"
  1804.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1805.    Str2 = "*lights"
  1806.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1807.    Str2 = "??der*sky*ligh??*"
  1808.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1809.    Str2 = "Under?the * s??,*"
  1810.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1811.    Str2 = "'U-U''a-z''a-z''a-z''a-z'?the *"
  1812.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1813.    Str2 = "'U-U''!A-Z''^A-Z''^A-Z''!A-Z'?the *'s-s'"
  1814.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1815.    Str2 = "~55~6E*~73"
  1816.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1817.    Str2 = "'Uu''Nn''dD''eE''opqrst'?the *'rstu'"
  1818.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1819.    Str2 = "Under?the *'~72~73~74~75'"
  1820.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf & vbCrLf
  1821.    Str2 = "*under*"
  1822.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1823.    Str2 = "Under*sun"
  1824.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1825.    Str2 = "Under t??e*"
  1826.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1827.    Str2 = "'U-U''!a-z''^A-Z''^A-Z''!A-Z'?the *'!s-s'"
  1828.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1829.    Str2 = "~55~6G*~73"
  1830.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1831.    Str2 = "'Uu''Nn''dD''eE''opqrst'?the *'rStu'"
  1832.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf
  1833.    Str2 = "Under?the *'~72~53~74~75'"
  1834.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatch(Str1, Str2) & vbCrLf & vbCrLf
  1835.    strDisplay = strDisplay & "PatternExtMatchS (case insensitive) '" & Str1 & "' with" & vbCrLf & vbCrLf
  1836.    Str2 = "*"
  1837.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1838.    Str2 = "*??*???*?"
  1839.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1840.    Str2 = "*Under*"
  1841.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1842.    Str2 = "*sky*"
  1843.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1844.    Str2 = "*lights"
  1845.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1846.    Str2 = "??der*sky*ligh??*"
  1847.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1848.    Str2 = "Under?the * s??,*"
  1849.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1850.    Str2 = "'U-U''a-z''a-z''a-z''a-z'?the *"
  1851.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1852.    Str2 = "'U-U''!A-Z''^A-Z''^A-Z''!A-Z'?the *'s-s'"
  1853.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1854.    Str2 = "~55~6E*~73"
  1855.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1856.    Str2 = "'Uu''Nn''dD''eE''opqrst'?the *'rstu'"
  1857.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1858.    Str2 = "Under?the *'~72~73~74~75'"
  1859.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf & vbCrLf
  1860.    Str2 = "*under*"
  1861.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1862.    Str2 = "Under*sun"
  1863.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1864.    Str2 = "Under t??e*"
  1865.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1866.    Str2 = "'U-U''!a-z''^A-Z''^A-Z''!A-Z'?the *'!s-s'"
  1867.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1868.    Str2 = "~55~6G*~73"
  1869.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1870.    Str2 = "'Uu''Nn''dD''eE''opqrst'?the *'rStu'"
  1871.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf
  1872.    Str2 = "Under?the *'~72~53~74~75'"
  1873.    strDisplay = strDisplay & "'" & Str2 & "'  is " & cPatternExtMatchS(Str1, Str2, False) & vbCrLf & vbCrLf
  1874.    txt_Result = strDisplay
  1875.    'time the function
  1876.    Str2 = "Under?the * s??,*"
  1877.    TimerHandle = cTimerOpen()
  1878.    TimerStartOk = cTimerStart(TimerHandle)
  1879.    For i = 1 To Iteration
  1880.       intResult = cPatternExtMatch(Str1, Str2)
  1881.    Next i
  1882.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1883.    TimerCloseOk = cTimerClose(TimerHandle)
  1884. End Sub
  1885. Private Sub TestCheckNumericity()
  1886.    Dim intResult        As Integer
  1887.    Dim strResult        As String
  1888.    Dim strDisplay       As String
  1889.    Dim i                As Integer
  1890.    Dim Str1             As String
  1891.    intResult = 0
  1892.    strResult = ""
  1893.    strDisplay = ""
  1894.      
  1895.    Str1 = Text1.Text
  1896.    strDisplay = strDisplay & "'" & Str1 & "' is "
  1897.    strDisplay = strDisplay & IIf(cCheckNumericity(Str1), "Numeric", "not Numeric") & vbCrLf & vbCrLf
  1898.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  1899.    strDisplay = strDisplay & "'" & Str1 & "' is "
  1900.    strDisplay = strDisplay & IIf(cCheckNumericity(Str1), "Numeric", "not Numeric") & vbCrLf & vbCrLf
  1901.    Str1 = "1234567890"
  1902.    strDisplay = strDisplay & "'" & Str1 & "' is "
  1903.    strDisplay = strDisplay & IIf(cCheckNumericity(Str1), "Numeric", "not Numeric") & vbCrLf & vbCrLf
  1904.    Str1 = "-1234567890"
  1905.    strDisplay = strDisplay & "'" & Str1 & "' is "
  1906.    strDisplay = strDisplay & IIf(cCheckNumericity(Str1), "Numeric", "not Numeric") & vbCrLf & vbCrLf
  1907.    Str1 = "+12345.67890"
  1908.    strDisplay = strDisplay & "'" & Str1 & "' is "
  1909.    strDisplay = strDisplay & IIf(cCheckNumericity(Str1), "Numeric", "not Numeric") & vbCrLf & vbCrLf
  1910.    txt_Result = strDisplay
  1911.    'time the function
  1912.    Str1 = Text1.Text
  1913.    TimerHandle = cTimerOpen()
  1914.    TimerStartOk = cTimerStart(TimerHandle)
  1915.    For i = 1 To Iteration
  1916.       intResult = cCheckNumericity(Str1)
  1917.    Next i
  1918.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1919.    TimerCloseOk = cTimerClose(TimerHandle)
  1920. End Sub
  1921. Private Sub TestAlphaDigit()
  1922.    Dim intResult        As Integer
  1923.    Dim strResult        As String
  1924.    Dim strDisplay       As String
  1925.    Dim i                As Integer
  1926.    Dim Str1             As String
  1927.    intResult = 0
  1928.    strResult = ""
  1929.    strDisplay = ""
  1930.      
  1931.    Str1 = "1234567890"
  1932.    strDisplay = strDisplay & "Add digit in '" & Str1 & "' is '" & cAddDigit(Str1) & "'" & vbCrLf & vbCrLf
  1933.    strDisplay = strDisplay & "Num digit in '" & Str1 & "' is '" & cNumDigit(Str1) & "'" & vbCrLf & vbCrLf
  1934.    strDisplay = strDisplay & "Cpl digit in '" & Str1 & "' is '" & cCplDigit(Str1) & "'" & vbCrLf & vbCrLf
  1935.    strDisplay = strDisplay & "Cpl alpha in '" & Str1 & "' is '" & cCplAlpha(Str1) & "'" & vbCrLf & vbCrLf & vbCrLf
  1936.    Str1 = Text1.Text
  1937.    strDisplay = strDisplay & "Add digit in '" & Str1 & "' is '" & cAddDigit(Str1) & "'" & vbCrLf & vbCrLf
  1938.    strDisplay = strDisplay & "Num digit in '" & Str1 & "' is '" & cNumDigit(Str1) & "'" & vbCrLf & vbCrLf
  1939.    strDisplay = strDisplay & "Cpl digit in '" & Str1 & "' is '" & cCplDigit(Str1) & "'" & vbCrLf & vbCrLf
  1940.    strDisplay = strDisplay & "Cpl alpha in '" & Str1 & "' is '" & cCplAlpha(Str1) & "'"
  1941.    txt_Result = strDisplay
  1942.    'time the function
  1943.    Str1 = Text1.Text
  1944.    TimerHandle = cTimerOpen()
  1945.    TimerStartOk = cTimerStart(TimerHandle)
  1946.    For i = 1 To Iteration
  1947.       intResult = cAddDigit(Str1)
  1948.    Next i
  1949.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1950.    TimerCloseOk = cTimerClose(TimerHandle)
  1951. End Sub
  1952. Private Sub TestH2X()
  1953.    Dim intResult        As Integer
  1954.    Dim strResult        As String
  1955.    Dim strDisplay       As String
  1956.    Dim i                As Integer
  1957.    Dim Str1             As String
  1958.    intResult = 0
  1959.    strResult = ""
  1960.    strDisplay = ""
  1961.      
  1962.    strDisplay = "Hexa to Integer" & vbCrLf & vbCrLf
  1963.    Str1 = "0"
  1964.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf
  1965.    Str1 = "1"
  1966.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf
  1967.    Str1 = "A"
  1968.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf
  1969.    Str1 = "A1"
  1970.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf
  1971.    Str1 = "A1B"
  1972.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf
  1973.    Str1 = "7FFF"
  1974.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf
  1975.    Str1 = "A1B2"
  1976.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf
  1977.    Str1 = "FFFF"
  1978.    strDisplay = strDisplay & Str1 & " -> " & cH2I(Str1) & vbCrLf & vbCrLf
  1979.    strDisplay = strDisplay & "Hexa to Long" & vbCrLf & vbCrLf
  1980.    Str1 = "0"
  1981.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1982.    Str1 = "1"
  1983.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1984.    Str1 = "A"
  1985.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1986.    Str1 = "A1"
  1987.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1988.    Str1 = "A1B"
  1989.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1990.    Str1 = "A1B2"
  1991.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1992.    Str1 = "7FFFFFFF"
  1993.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1994.    Str1 = "B2A1A1B2"
  1995.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf
  1996.    Str1 = "FFFFFFFF"
  1997.    strDisplay = strDisplay & Str1 & " -> " & cH2L(Str1) & vbCrLf & vbCrLf
  1998.    txt_Result = strDisplay
  1999.    'time the function
  2000.    Str1 = Text1.Text
  2001.    TimerHandle = cTimerOpen()
  2002.    TimerStartOk = cTimerStart(TimerHandle)
  2003.    For i = 1 To Iteration
  2004.       intResult = cH2I(Str1)
  2005.    Next i
  2006.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2007.    TimerCloseOk = cTimerClose(TimerHandle)
  2008. End Sub
  2009. Private Sub TestSortStr()
  2010.    Dim intResult        As Integer
  2011.    Dim strResult        As String
  2012.    Dim strDisplay       As String
  2013.    Dim i                As Integer
  2014.    Dim Str1             As String
  2015.    intResult = 0
  2016.    strResult = ""
  2017.    strDisplay = ""
  2018.      
  2019.    Str1 = Text1.Text
  2020.    Str1 = cResizeStringAndFill(Str1, 60, " ")
  2021.    strDisplay = strDisplay & "SortStr of '" & Str1 & "' is" & vbCrLf & vbCrLf
  2022.    intResult = cSortStr(Str1, 20, 3)
  2023.    strDisplay = strDisplay & "'" & Str1 & "'" & vbCrLf & vbCrLf
  2024.    Str1 = "ABCBCABECAEB"
  2025.    strDisplay = strDisplay & "SortStr of '" & Str1 & "' is" & vbCrLf & vbCrLf
  2026.    intResult = cSortStr(Str1, 4, 3)
  2027.    strDisplay = strDisplay & "'" & Str1 & "'" & vbCrLf & vbCrLf & vbCrLf
  2028.    Str1 = Text1.Text
  2029.    Str1 = cResizeStringAndFill(Str1, 60, " ")
  2030.    strDisplay = strDisplay & "ReverseSortStr of '" & Str1 & "' is" & vbCrLf & vbCrLf
  2031.    intResult = cReverseSortStr(Str1, 20, 3)
  2032.    strDisplay = strDisplay & "'" & Str1 & "'" & vbCrLf & vbCrLf
  2033.    Str1 = "ABCBCABECAEB"
  2034.    strDisplay = strDisplay & "ReverseSortStr of '" & Str1 & "' is" & vbCrLf & vbCrLf
  2035.    intResult = cReverseSortStr(Str1, 4, 3)
  2036.    strDisplay = strDisplay & "'" & Str1 & "'" & vbCrLf & vbCrLf
  2037.    txt_Result = strDisplay
  2038.    'time the function
  2039.    Str1 = Text1.Text
  2040.    TimerHandle = cTimerOpen()
  2041.    TimerStartOk = cTimerStart(TimerHandle)
  2042.    For i = 1 To Iteration
  2043.       strResult = cSortStr(Str1, 4, 3)
  2044.    Next i
  2045.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2046.    TimerCloseOk = cTimerClose(TimerHandle)
  2047. End Sub
  2048. Private Sub TestMorse()
  2049.    Dim intResult        As Integer
  2050.    Dim strResult        As String
  2051.    Dim strDisplay       As String
  2052.    Dim i                As Integer
  2053.    Dim Str1             As String
  2054.    intResult = 0
  2055.    strResult = ""
  2056.    strDisplay = ""
  2057.      
  2058.    Str1 = Text1.Text
  2059.    strDisplay = strDisplay + "Morse code of '" & Str1 & "' is " & cMorse(Str1) & vbCrLf & vbCrLf
  2060.    Str1 = "SOS"
  2061.    strDisplay = strDisplay + "Morse code of '" & Str1 & "' is " & cMorse(Str1) & vbCrLf & vbCrLf
  2062.    Str1 = "T2WIN-32"
  2063.    strDisplay = strDisplay + "Morse code of '" & Str1 & "' is " & cMorse(Str1) & vbCrLf & vbCrLf
  2064.    Str1 = "Nothing can beat the fox"
  2065.    strDisplay = strDisplay + "Morse code of '" & Str1 & "' is " & cMorse(Str1) & vbCrLf & vbCrLf
  2066.    txt_Result = strDisplay
  2067.    'time the function
  2068.    Str1 = Text1.Text
  2069.    TimerHandle = cTimerOpen()
  2070.    TimerStartOk = cTimerStart(TimerHandle)
  2071.    For i = 1 To Iteration
  2072.       strResult = cMorse(Str1)
  2073.    Next i
  2074.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2075.    TimerCloseOk = cTimerClose(TimerHandle)
  2076. End Sub
  2077. Private Sub TestToZ9()
  2078.    Dim intResult        As Integer
  2079.    Dim strResult        As String
  2080.    Dim strDisplay       As String
  2081.    Dim i                As Integer
  2082.    Dim Str1             As String
  2083.    Dim Str2             As String
  2084.    intResult = 0
  2085.    strResult = ""
  2086.    strDisplay = ""
  2087.    Str1 = Text1.Text
  2088.    Str2 = cToZ9(Str1)
  2089.    strDisplay = strDisplay & "To Z9 of '" & Str1 & "' is" & vbCrLf & vbCrLf
  2090.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  2091.    strDisplay = strDisplay & "From Z9 of '" & Str2 & "' is" & vbCrLf & vbCrLf
  2092.    strDisplay = strDisplay & "'" & cFromZ9(Str2) & "'" & vbCrLf & vbCrLf
  2093.    Str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  2094.    Str2 = cToZ9(Str1)
  2095.    strDisplay = strDisplay & "To Z9 of '" & Str1 & "' is" & vbCrLf & vbCrLf
  2096.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  2097.    strDisplay = strDisplay & "From Z9 of '" & Str2 & "' is" & vbCrLf & vbCrLf
  2098.    strDisplay = strDisplay & "'" & cFromZ9(Str2) & "'" & vbCrLf & vbCrLf
  2099.    Str1 = "01234567890"
  2100.    Str2 = cToZ9(Str1)
  2101.    strDisplay = strDisplay & "To Z9 of '" & Str1 & "' is" & vbCrLf & vbCrLf
  2102.    strDisplay = strDisplay & "'" & Str2 & "'" & vbCrLf & vbCrLf
  2103.    strDisplay = strDisplay & "From Z9 of '" & Str2 & "' is" & vbCrLf & vbCrLf
  2104.    strDisplay = strDisplay & "'" & cFromZ9(Str2) & "'"
  2105.    txt_Result = strDisplay
  2106.    'time the function
  2107.    Str1 = Text1.Text
  2108.    TimerHandle = cTimerOpen()
  2109.    TimerStartOk = cTimerStart(TimerHandle)
  2110.    For i = 1 To Iteration
  2111.       strResult = cToZ9(Str1)
  2112.    Next i
  2113.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2114.    TimerCloseOk = cTimerClose(TimerHandle)
  2115. End Sub
  2116. Private Sub TestDeleteSubString()
  2117.    Dim intResult        As Integer
  2118.    Dim strResult        As String
  2119.    Dim strDisplay       As String
  2120.    Dim i                As Integer
  2121.    Dim Str1             As String
  2122.    intResult = 0
  2123.    strResult = ""
  2124.    strDisplay = ""
  2125.      
  2126.    Str1 = Text1.Text
  2127.    strDisplay = strDisplay & "Case Insensitive and Case Sensitive" & vbCrLf & vbCrLf
  2128.    strDisplay = strDisplay & "Delete '' into '" & Str1 & "' is " & vbCrLf
  2129.    strDisplay = strDisplay & cDeleteSubString(Str1, "", False) & vbCrLf
  2130.    strDisplay = strDisplay & cDeleteSubString(Str1, "", True) & vbCrLf & vbCrLf
  2131.    strDisplay = strDisplay & "Delete 'a' into '" & Str1 & "' is " & vbCrLf
  2132.    strDisplay = strDisplay & cDeleteSubString(Str1, "a", False) & vbCrLf
  2133.    strDisplay = strDisplay & cDeleteSubString(Str1, "a", True) & vbCrLf & vbCrLf
  2134.    strDisplay = strDisplay & "Delete 'A' into '" & Str1 & "' is " & vbCrLf
  2135.    strDisplay = strDisplay & cDeleteSubString(Str1, "A", False) & vbCrLf
  2136.    strDisplay = strDisplay & cDeleteSubString(Str1, "A", True) & vbCrLf & vbCrLf
  2137.    strDisplay = strDisplay & "Delete 'mnop' into '" & Str1 & "' is " & vbCrLf
  2138.    strDisplay = strDisplay & cDeleteSubString(Str1, "mnop", False) & vbCrLf
  2139.    strDisplay = strDisplay & cDeleteSubString(Str1, "mnop", True) & vbCrLf & vbCrLf
  2140.    strDisplay = strDisplay & "Delete 'bcd' into '" & Str1 & "' is " & vbCrLf
  2141.    strDisplay = strDisplay & cDeleteSubString(Str1, "bcd", False) & vbCrLf
  2142.    strDisplay = strDisplay & cDeleteSubString(Str1, "bcd", True) & vbCrLf & vbCrLf
  2143.    Str1 = "this is a test and this is an another test"
  2144.    strDisplay = strDisplay & "Delete 'is' into '" & Str1 & "' is " & vbCrLf
  2145.    strDisplay = strDisplay & cDeleteSubString(Str1, "is", False) & vbCrLf
  2146.    strDisplay = strDisplay & cDeleteSubString(Str1, "is", True) & vbCrLf & vbCrLf
  2147.    strDisplay = strDisplay & "Delete 'test' into '" & Str1 & "' is " & vbCrLf
  2148.    strDisplay = strDisplay & cDeleteSubString(Str1, "test", False) & vbCrLf
  2149.    strDisplay = strDisplay & cDeleteSubString(Str1, "test", True) & vbCrLf & vbCrLf
  2150.    txt_Result = strDisplay
  2151.    'time the function
  2152.    TimerHandle = cTimerOpen()
  2153.    TimerStartOk = cTimerStart(TimerHandle)
  2154.    For i = 1 To Iteration
  2155.       strResult = cDeleteSubString(Str1, "a", False)
  2156.    Next i
  2157.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2158.    TimerCloseOk = cTimerClose(TimerHandle)
  2159. End Sub
  2160. Private Sub TestStringReplace()
  2161.    Dim intResult        As Integer
  2162.    Dim strResult        As String
  2163.    Dim strDisplay       As String
  2164.    Dim i                As Integer
  2165.    Dim Str1             As String
  2166.    Dim Str2             As String
  2167.    intResult = 0
  2168.    strResult = ""
  2169.    strDisplay = ""
  2170.      
  2171.    Str1 = Text1.Text
  2172.    Str2 = "/bc/|/BC/"
  2173.    strDisplay = strDisplay & "Case Insensitive and Case Sensitive" & vbCrLf & vbCrLf
  2174.    strDisplay = strDisplay & "Process '" & Str1 & "' with '" & Str2 & "' is " & vbCrLf & vbCrLf
  2175.    strDisplay = strDisplay & cStringReplace(Str1, Str2, False) & vbCrLf
  2176.    strDisplay = strDisplay & cStringReplace(Str1, Str2, True) & vbCrLf & vbCrLf
  2177.    Str1 = "this si a test and this is na another test"
  2178.    Str2 = "si|is;na|an"
  2179.    strDisplay = strDisplay & "Process '" & Str1 & "' with '" & Str2 & "' is " & vbCrLf & vbCrLf
  2180.    strDisplay = strDisplay & cStringReplace(Str1, Str2, False) & vbCrLf
  2181.    strDisplay = strDisplay & cStringReplace(Str1, Str2, True) & vbCrLf & vbCrLf
  2182.    Str1 = "this si a test and this is na another test"
  2183.    Str2 = "this si a test|this is an another test;this is na another test|this is really an another test"
  2184.    strDisplay = strDisplay & "Process '" & Str1 & "' with '" & Str2 & "' is " & vbCrLf & vbCrLf
  2185.    strDisplay = strDisplay & cStringReplace(Str1, Str2, False) & vbCrLf
  2186.    strDisplay = strDisplay & cStringReplace(Str1, Str2, True) & vbCrLf & vbCrLf
  2187.    txt_Result = strDisplay
  2188.    'time the function
  2189.    TimerHandle = cTimerOpen()
  2190.    TimerStartOk = cTimerStart(TimerHandle)
  2191.    For i = 1 To Iteration
  2192.       strResult = cStringReplace(Str1, Str2, False)
  2193.    Next i
  2194.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2195.    TimerCloseOk = cTimerClose(TimerHandle)
  2196. End Sub
  2197. Private Sub TestLRFill()
  2198.    Dim intResult        As Integer
  2199.    Dim strResult        As String
  2200.    Dim strDisplay       As String
  2201.    Dim i                As Integer
  2202.    Dim Str1             As String
  2203.    intResult = 0
  2204.    strResult = ""
  2205.    strDisplay = ""
  2206.      
  2207.    Str1 = "1234"
  2208.    strDisplay = strDisplay & "NewLength = 10" & vbCrLf & vbCrLf
  2209.    strDisplay = strDisplay & "LFill '" & Str1 & "' with ' ' is " & vbCrLf
  2210.    strDisplay = strDisplay & cLFill(Str1, " ", 10) & vbCrLf & vbCrLf
  2211.    strDisplay = strDisplay & "LFill '" & Str1 & "' with '0' is " & vbCrLf
  2212.    strDisplay = strDisplay & cLFill(Str1, "0", 10) & vbCrLf & vbCrLf
  2213.    strDisplay = strDisplay & "LFill '" & Str1 & "' with '_' is " & vbCrLf
  2214.    strDisplay = strDisplay & cLFill(Str1, "_", 10) & vbCrLf & vbCrLf
  2215.    strDisplay = strDisplay & "LFill '" & Str1 & "' with '' is " & vbCrLf
  2216.    strDisplay = strDisplay & cLFill(Str1, "", 10) & vbCrLf & vbCrLf
  2217.    strDisplay = strDisplay & vbCrLf & vbCrLf
  2218.    strDisplay = strDisplay & "RFill '" & Str1 & "' with ' ' is " & vbCrLf
  2219.    strDisplay = strDisplay & cRFill(Str1, " ", 10) & vbCrLf & vbCrLf
  2220.    strDisplay = strDisplay & "RFill '" & Str1 & "' with '0' is " & vbCrLf
  2221.    strDisplay = strDisplay & cRFill(Str1, "0", 10) & vbCrLf & vbCrLf
  2222.    strDisplay = strDisplay & "RFill '" & Str1 & "' with '_' is " & vbCrLf
  2223.    strDisplay = strDisplay & cRFill(Str1, "_", 10) & vbCrLf & vbCrLf
  2224.    strDisplay = strDisplay & "RFill '" & Str1 & "' with '' is " & vbCrLf
  2225.    strDisplay = strDisplay & cRFill(Str1, "", 10) & vbCrLf & vbCrLf
  2226.    txt_Result = strDisplay
  2227.    'time the function
  2228.    TimerHandle = cTimerOpen()
  2229.    TimerStartOk = cTimerStart(TimerHandle)
  2230.    For i = 1 To Iteration
  2231.       strResult = cLFill(Str1, "0", 10)
  2232.    Next i
  2233.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2234.    TimerCloseOk = cTimerClose(TimerHandle)
  2235. End Sub
  2236. Private Sub TestLRSetIn()
  2237.    Dim intResult        As Integer
  2238.    Dim strResult        As String
  2239.    Dim strDisplay       As String
  2240.    Dim i                As Integer
  2241.    Dim Str1             As String
  2242.    intResult = 0
  2243.    strResult = ""
  2244.    strDisplay = ""
  2245.      
  2246.    Str1 = Text1.Text
  2247.    strDisplay = strDisplay & "Insert '' on the left in block 5 into '" & Str1 & "' is " & vbCrLf
  2248.    strDisplay = strDisplay & cLSetIn(Str1, "/", 5, "") & vbCrLf & vbCrLf
  2249.    strDisplay = strDisplay & "Insert '*' on the left in block 1 into '" & Str1 & "' is " & vbCrLf
  2250.    strDisplay = strDisplay & cLSetIn(Str1, "/", 1, "*") & vbCrLf & vbCrLf
  2251.    strDisplay = strDisplay & "Insert '***' on the left in block 3 into '" & Str1 & "' is " & vbCrLf
  2252.    strDisplay = strDisplay & cLSetIn(Str1, "/", 3, "***") & vbCrLf & vbCrLf
  2253.    strDisplay = strDisplay & "Insert '*******' on the left in block 7 into '" & Str1 & "' is " & vbCrLf
  2254.    strDisplay = strDisplay & cLSetIn(Str1, "/", 7, "*******") & vbCrLf & vbCrLf
  2255.    strDisplay = strDisplay & vbCrLf & vbCrLf
  2256.    strDisplay = strDisplay & "Insert '' on the right in block 5 into '" & Str1 & "' is " & vbCrLf
  2257.    strDisplay = strDisplay & cRSetIn(Str1, "/", 5, "") & vbCrLf & vbCrLf
  2258.    strDisplay = strDisplay & "Insert '*' on the right in block 1 into '" & Str1 & "' is " & vbCrLf
  2259.    strDisplay = strDisplay & cRSetIn(Str1, "/", 1, "*") & vbCrLf & vbCrLf
  2260.    strDisplay = strDisplay & "Insert '***' on the right in block 3 into '" & Str1 & "' is " & vbCrLf
  2261.    strDisplay = strDisplay & cRSetIn(Str1, "/", 3, "***") & vbCrLf & vbCrLf
  2262.    strDisplay = strDisplay & "Insert '*******' on the right in block 7 into '" & Str1 & "' is " & vbCrLf
  2263.    strDisplay = strDisplay & cRSetIn(Str1, "/", 7, "*******") & vbCrLf & vbCrLf
  2264.    txt_Result = strDisplay
  2265.    'time the function
  2266.    TimerHandle = cTimerOpen()
  2267.    TimerStartOk = cTimerStart(TimerHandle)
  2268.    For i = 1 To Iteration
  2269.       strResult = cLSetIn(Str1, "/", 7, "*******")
  2270.    Next i
  2271.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2272.    TimerCloseOk = cTimerClose(TimerHandle)
  2273. End Sub
  2274. Private Sub TestMatchTable()
  2275.    Dim intResult        As Integer
  2276.    Dim strResult        As String
  2277.    Dim strDisplay       As String
  2278.    Dim i                As Integer
  2279.    Dim Str1             As String
  2280.    Dim Str2             As String
  2281.    intResult = 0
  2282.    strResult = ""
  2283.    strDisplay = ""
  2284.      
  2285.    Str1 = Text1.Text
  2286.       
  2287.    strDisplay = strDisplay & "Match '' (case sensitive) in '" & Str1 & "' is " & vbCrLf
  2288.    strDisplay = strDisplay & cMatchTable("", Str1, "/", True) & vbCrLf & vbCrLf
  2289.    strDisplay = strDisplay & "Match 'bc' (case sensitive) in '" & Str1 & "' is " & vbCrLf
  2290.    strDisplay = strDisplay & cMatchTable("bc", Str1, "/", True) & vbCrLf & vbCrLf
  2291.    strDisplay = strDisplay & "Match 'bc' (case insensitive) in '" & Str1 & "' is " & vbCrLf
  2292.    strDisplay = strDisplay & cMatchTable("bc", Str1, "/", False) & vbCrLf & vbCrLf
  2293.    strDisplay = strDisplay & "Match 'BC' (case sensitive) in '" & Str1 & "' is " & vbCrLf
  2294.    strDisplay = strDisplay & cMatchTable("BC", Str1, "/", True) & vbCrLf & vbCrLf
  2295.    strDisplay = strDisplay & "Match 'BC' (case insensitive) in '" & Str1 & "' is " & vbCrLf
  2296.    strDisplay = strDisplay & cMatchTable("BC", Str1, "/", False) & vbCrLf & vbCrLf
  2297.    strDisplay = strDisplay & "Match 'abc' (case sensitive) in '" & Str1 & "' is " & vbCrLf
  2298.    strDisplay = strDisplay & cMatchTable("abc", Str1, "/", True) & vbCrLf & vbCrLf
  2299.    strDisplay = strDisplay & "Match 'abc' (case insensitive) in '" & Str1 & "' is " & vbCrLf
  2300.    strDisplay = strDisplay & cMatchTable("abc", Str1, "/", False) & vbCrLf & vbCrLf
  2301.    txt_Result = strDisplay
  2302.    'time the function
  2303.    Str1 = Text1.Text
  2304.    TimerHandle = cTimerOpen()
  2305.    TimerStartOk = cTimerStart(TimerHandle)
  2306.    For i = 1 To Iteration
  2307.       intResult = cMatchTable("klmnop", Str1, "/", True)
  2308.    Next i
  2309.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2310.    TimerCloseOk = cTimerClose(TimerHandle)
  2311. End Sub
  2312. Private Sub TestInStr()
  2313.    Dim intResult        As Integer
  2314.    Dim strResult        As String
  2315.    Dim strDisplay       As String
  2316.    Dim i                As Integer
  2317.    Dim Str1             As String
  2318.    Dim Str2             As String
  2319.    intResult = 0
  2320.    strResult = ""
  2321.    strDisplay = ""
  2322.      
  2323.    Str1 = Text1.Text
  2324.       
  2325.    strDisplay = strDisplay & "Find '' (case sensitive) in '" & Str1 & "' is " & vbCrLf
  2326.    strDisplay = strDisplay & cInStr(1, Str1, "", True) & vbCrLf & vbCrLf
  2327.    strDisplay = strDisplay & "Find 'bc' (case sensitive) in '' is " & vbCrLf
  2328.    strDisplay = strDisplay & cInStr(1, "", "bc", True) & vbCrLf & vbCrLf
  2329.    strDisplay = strDisplay & "Find '' (case sensitive) in '' is " & vbCrLf
  2330.    strDisplay = strDisplay & cInStr(1, "", "", True) & vbCrLf & vbCrLf
  2331.    strDisplay = strDisplay & "Find 'bc' (case sensitive) in '" & Str1 & "' is " & vbCrLf
  2332.    strDisplay = strDisplay & cInStr(1, Str1, "bc", True) & vbCrLf & vbCrLf
  2333.    strDisplay = strDisplay & "Find 'bc' (case insensitive) in '" & Str1 & "' is " & vbCrLf
  2334.    strDisplay = strDisplay & cInStr(1, Str1, "bc", False) & vbCrLf & vbCrLf
  2335.    strDisplay = strDisplay & "Find 'bc' (case sensitive) from position 7 in '" & Str1 & "' is " & vbCrLf
  2336.    strDisplay = strDisplay & cInStr(7, Str1, "bc", True) & vbCrLf & vbCrLf
  2337.    strDisplay = strDisplay & "Find 'bc' (case insensitive) from position 7 in '" & Str1 & "' is " & vbCrLf
  2338.    strDisplay = strDisplay & cInStr(7, Str1, "bc", False) & vbCrLf & vbCrLf
  2339.    strDisplay = strDisplay & "Find 'BC' (case sensitive) in '" & Str1 & "' is " & vbCrLf
  2340.    strDisplay = strDisplay & cInStr(1, Str1, "BC", True) & vbCrLf & vbCrLf
  2341.    strDisplay = strDisplay & "Find 'BC' (case insensitive) in '" & Str1 & "' is " & vbCrLf
  2342.    strDisplay = strDisplay & cInStr(1, Str1, "BC", False) & vbCrLf & vbCrLf
  2343.    strDisplay = strDisplay & "Find 'BC' (case sensitive) from position 7 in '" & Str1 & "' is " & vbCrLf
  2344.    strDisplay = strDisplay & cInStr(7, Str1, "BC", True) & vbCrLf & vbCrLf
  2345.    strDisplay = strDisplay & "Find 'BC' (case insensitive) from position 7 in '" & Str1 & "' is " & vbCrLf
  2346.    strDisplay = strDisplay & cInStr(7, Str1, "BC", False) & vbCrLf & vbCrLf
  2347.    strDisplay = strDisplay & "Find 'BC' (case insensitive) from position 0 in '" & Str1 & "' is " & vbCrLf
  2348.    strDisplay = strDisplay & cInStr(0, Str1, "BC", False) & vbCrLf & vbCrLf
  2349.    txt_Result = strDisplay
  2350.    'time the function
  2351.    Str1 = Text1.Text
  2352.    TimerHandle = cTimerOpen()
  2353.    TimerStartOk = cTimerStart(TimerHandle)
  2354.    For i = 1 To Iteration
  2355.       intResult = cInStr(1, Str1, "klmnop", True)
  2356.    Next i
  2357.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2358.    TimerCloseOk = cTimerClose(TimerHandle)
  2359. End Sub
  2360. Private Sub TestExtract()
  2361.    Dim intResult        As Integer
  2362.    Dim strResult        As String
  2363.    Dim strDisplay       As String
  2364.    Dim i                As Integer
  2365.    Dim Str1             As String
  2366.    Dim Str2             As String
  2367.    intResult = 0
  2368.    strResult = ""
  2369.    strDisplay = ""
  2370.      
  2371.    Str1 = Str1 + "Path: ourworld.compuserve.com/homepages/alpouda" & vbCrLf
  2372.    Str1 = Str1 + "From: time to win 32-bit" & vbCrLf
  2373.    Str1 = Str1 + "Newsgroups: comp.lang.basic.visual.misc" & vbCrLf
  2374.    Str1 = Str1 + "Subject: extract a sub-string with a key" & vbCrLf
  2375.    Str1 = Str1 + "Date: 17 Aug 1997 16:25:43 GMT" & vbCrLf
  2376.    Str1 = Str1 + "Organization: The M.C.R. Company" & vbCrLf
  2377.    Str1 = Str1 + "Lines: 25" & vbCrLf
  2378.    Str1 = Str1 + "Message-ID: <5t5u41$8ai$11@ourworld.compuserve.com>" & vbCrLf
  2379.    Str1 = Str1 + "NNTP-Posting-Host: ppp054.103.ourworld.compuserve.com" & vbCrLf
  2380.    Str1 = Str1 + "Post-Count: 000518" & vbCrLf
  2381.    Str1 = Str1 + "Xref: time to win 32-bit (v" & cGetVersion() & ")" & vbCrLf
  2382.       
  2383.    strDisplay = strDisplay & Str1 & vbCrLf
  2384.    strDisplay = strDisplay & "Extract data for the following key (field separator = Cr+Lf; sensitivity = True) :" & vbCrLf & vbCrLf
  2385.    strDisplay = strDisplay & "Path:" & vbCrLf & cExtract(Str1, "Path:", vbCrLf, True) & vbCrLf
  2386.    strDisplay = strDisplay & "From:" & vbCrLf & cExtract(Str1, "From:", vbCrLf, True) & vbCrLf
  2387.    strDisplay = strDisplay & "Newsgroups:" & vbCrLf & cExtract(Str1, "Newsgroups:", vbCrLf, True) & vbCrLf
  2388.    strDisplay = strDisplay & "Subject:" & vbCrLf & cExtract(Str1, "Subject:", vbCrLf, True) & vbCrLf
  2389.    strDisplay = strDisplay & "Organization:" & vbCrLf & cExtract(Str1, "Organization:", vbCrLf, True) & vbCrLf
  2390.    strDisplay = strDisplay & "Lines:" & vbCrLf & cExtract(Str1, "Lines:", vbCrLf, True) & vbCrLf
  2391.    strDisplay = strDisplay & "Message-ID:" & vbCrLf & cExtract(Str1, "Message-ID:", vbCrLf, True) & vbCrLf
  2392.    strDisplay = strDisplay & "NNTP-Posting-Host:" & vbCrLf & cExtract(Str1, "NNTP-Posting-Host:", vbCrLf, True) & vbCrLf
  2393.    strDisplay = strDisplay & "Post-Count:" & vbCrLf & cExtract(Str1, "Post-Count:", vbCrLf, True) & vbCrLf
  2394.    strDisplay = strDisplay & "Xref:" & vbCrLf & cExtract(Str1, "Xref:", vbCrLf, True) & vbCrLf & vbCrLf
  2395.    strDisplay = strDisplay & "Extract data for the following key (field separator = Cr+Lf; sensitivity = True) :" & vbCrLf & vbCrLf
  2396.    strDisplay = strDisplay & "From:" & vbCrLf & cExtract(Str1, "From:", vbCrLf, True) & vbCrLf
  2397.    strDisplay = strDisplay & "from:" & vbCrLf & cExtract(Str1, "from:", vbCrLf, True) & vbCrLf & vbCrLf
  2398.    strDisplay = strDisplay & "Extract data for the following key (field separator = Cr+Lf; sensitivity = False) :" & vbCrLf & vbCrLf
  2399.    strDisplay = strDisplay & "From:" & vbCrLf & cExtract(Str1, "From:", vbCrLf, False) & vbCrLf
  2400.    strDisplay = strDisplay & "from:" & vbCrLf & cExtract(Str1, "from:", vbCrLf, False) & vbCrLf & vbCrLf
  2401.    strDisplay = strDisplay & "Extract data for the following key (field separator = ""; sensitivity = False) :" & vbCrLf & vbCrLf
  2402.    strDisplay = strDisplay & "From:" & vbCrLf & cExtract(Str1, "From:", "", False) & vbCrLf
  2403.    strDisplay = strDisplay & "from:" & vbCrLf & cExtract(Str1, "from:", "", False) & vbCrLf
  2404.    txt_Result = strDisplay
  2405.    'time the function
  2406.    TimerHandle = cTimerOpen()
  2407.    TimerStartOk = cTimerStart(TimerHandle)
  2408.    For i = 1 To Iteration
  2409.       strResult = cExtract(Str1, "Path:", vbCrLf, True)
  2410.    Next i
  2411.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2412.    TimerCloseOk = cTimerClose(TimerHandle)
  2413. End Sub
  2414. Private Sub TestExtractIsolate()
  2415.    Dim intResult        As Integer
  2416.    Dim strResult        As String
  2417.    Dim strDisplay       As String
  2418.    Dim i                As Integer
  2419.    Dim Str1             As String
  2420.    Dim Str2             As String
  2421.    intResult = 0
  2422.    strResult = ""
  2423.    strDisplay = ""
  2424.      
  2425.    Str1 = Str1 + "Path: ourworld.compuserve.com/homepages/alpouda" & vbCrLf
  2426.    Str1 = Str1 + "From: time to win 32-bit" & vbCrLf
  2427.    Str1 = Str1 + "Newsgroups: comp.lang.basic.visual.misc" & vbCrLf
  2428.    Str1 = Str1 + "" & vbCrLf
  2429.    Str1 = Str1 + "This is the body of the message" & vbCrLf
  2430.    Str1 = Str1 + "Nice DLL" & vbCrLf
  2431.       
  2432.    strDisplay = strDisplay & Str1 & vbCrLf
  2433.    strDisplay = strDisplay & "ExtractIsolate data for the following key (field separator = Cr+Lf; EXTRACT_ISOLATE_LEFT; sensitivity = True) :" & vbCrLf & vbCrLf
  2434.    strDisplay = strDisplay & "Path:" & vbCrLf & ">  " & cExtractIsolate(Str1, "Path:", vbCrLf, EXTRACT_ISOLATE_LEFT, True) & vbCrLf
  2435.    strDisplay = strDisplay & "From:" & vbCrLf & ">  " & cExtractIsolate(Str1, "From:", vbCrLf, EXTRACT_ISOLATE_LEFT, True) & vbCrLf
  2436.    strDisplay = strDisplay & "Newsgroups:" & vbCrLf & ">  " & cExtractIsolate(Str1, "Newsgroups:", vbCrLf, EXTRACT_ISOLATE_LEFT, True) & vbCrLf
  2437.    strDisplay = strDisplay & "''" & vbCrLf & ">  " & cExtractIsolate(Str1, "", vbCrLf, EXTRACT_ISOLATE_LEFT, True) & vbCrLf & vbCrLf
  2438.    strDisplay = strDisplay & "ExtractIsolate data for the following key (field separator = Cr+Lf; EXTRACT_ISOLATE_RIGHT; sensitivity = True) :" & vbCrLf & vbCrLf
  2439.    strDisplay = strDisplay & "Path:" & vbCrLf & ">  " & cExtractIsolate(Str1, "Path:", vbCrLf, EXTRACT_ISOLATE_RIGHT, True) & vbCrLf
  2440.    strDisplay = strDisplay & "From:" & vbCrLf & ">  " & cExtractIsolate(Str1, "From:", vbCrLf, EXTRACT_ISOLATE_RIGHT, True) & vbCrLf
  2441.    strDisplay = strDisplay & "Newsgroups:" & vbCrLf & ">  " & cExtractIsolate(Str1, "Newsgroups:", vbCrLf, EXTRACT_ISOLATE_RIGHT, True) & vbCrLf
  2442.    strDisplay = strDisplay & "''" & vbCrLf & ">  " & cExtractIsolate(Str1, "", vbCrLf, EXTRACT_ISOLATE_RIGHT, True) & vbCrLf & vbCrLf
  2443.    txt_Result = strDisplay
  2444.    'time the function
  2445.    TimerHandle = cTimerOpen()
  2446.    TimerStartOk = cTimerStart(TimerHandle)
  2447.    For i = 1 To Iteration
  2448.       strResult = cExtractIsolate(Str1, "", vbCrLf, EXTRACT_ISOLATE_RIGHT, True)
  2449.    Next i
  2450.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2451.    TimerCloseOk = cTimerClose(TimerHandle)
  2452. End Sub
  2453. Private Sub TestWrapLine()
  2454.    Dim intResult        As Integer
  2455.    Dim strResult        As String
  2456.    Dim strDisplay       As String
  2457.    Dim i                As Integer
  2458.    Dim Str1             As String
  2459.    Dim Str2             As String
  2460.    intResult = 0
  2461.    strResult = ""
  2462.    strDisplay = ""
  2463.      
  2464.    Str1 = Str1 & "123456789 123456789 1234567890 123456789 123456789 123456789 "
  2465.    Str1 = Str1 & "This is a line with some text, which is to long "
  2466.    Str1 = Str1 & "for the purpose we need it for." & vbCrLf & vbCrLf & "This "
  2467.    Str1 = Str1 & "means we have to do some word wrapping. "
  2468.    Str1 = Str1 & "That's why we need the cWrapLine() function."
  2469.         
  2470.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  2471.    strDisplay = strDisplay & "WrapLine on 30 characters :" & vbCrLf & vbCrLf
  2472.    strDisplay = strDisplay & cWrapLine(Str1, 30, " ", vbCrLf) & vbCrLf & vbCrLf
  2473.    strDisplay = strDisplay & "WrapLine on 40 characters :" & vbCrLf & vbCrLf
  2474.    strDisplay = strDisplay & cWrapLine(Str1, 40, " ", vbCrLf) & vbCrLf & vbCrLf
  2475.    strDisplay = strDisplay & "WrapLine on 60 characters :" & vbCrLf & vbCrLf
  2476.    strDisplay = strDisplay & cWrapLine(Str1, 60, " ", vbCrLf) & vbCrLf & vbCrLf
  2477.    txt_Result = strDisplay
  2478.    'time the function
  2479.    TimerHandle = cTimerOpen()
  2480.    TimerStartOk = cTimerStart(TimerHandle)
  2481.    For i = 1 To Iteration
  2482.       strResult = cWrapLine(Str1, 30, " ", vbCrLf)
  2483.    Next i
  2484.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2485.    TimerCloseOk = cTimerClose(TimerHandle)
  2486. End Sub
  2487. Private Sub TestRemoveReplace()
  2488.    Dim intResult        As Integer
  2489.    Dim strResult        As String
  2490.    Dim strDisplay       As String
  2491.    Dim i                As Integer
  2492.    Dim Str1             As String
  2493.       
  2494.    intResult = 0
  2495.    strResult = ""
  2496.    strDisplay = ""
  2497.      
  2498.    Str1 = Text1.Text
  2499.    strDisplay = strDisplay & "Replace the 7 char of '" & Str1 & "' with '?' is " & vbCrLf & vbCrLf
  2500.    Call cReplaceChar(Str1, 7, "?")
  2501.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  2502.    Str1 = Text1.Text
  2503.    strDisplay = strDisplay & "Replace the last char of '" & Str1 & "' with '!' is " & vbCrLf & vbCrLf
  2504.    Call cReplaceLastChar(Str1, "!")
  2505.    strDisplay = strDisplay & Str1 & vbCrLf & vbCrLf
  2506.    Str1 = Text1.Text
  2507.    strDisplay = strDisplay & "Remove the last char '" & Str1 & "' is " & vbCrLf & vbCrLf
  2508.    strDisplay = strDisplay & cRemoveLastChar(Str1) & vbCrLf & vbCrLf
  2509.    txt_Result = strDisplay
  2510.    'time the function
  2511.    Str1 = Text1.Text
  2512.    TimerHandle = cTimerOpen()
  2513.    TimerStartOk = cTimerStart(TimerHandle)
  2514.    For i = 1 To Iteration
  2515.       strResult = cRemoveLastChar(Str1)
  2516.    Next i
  2517.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2518.    TimerCloseOk = cTimerClose(TimerHandle)
  2519. End Sub
  2520.